local rad = math.random ( 1, 100 )
This means it'll randomly choose a number between 1 and 100
if rad<=50 then
If the random number is less than or equal to 50 do this
local Elf_URE = GetItemAttr(Item_Traget,ITEMATTR_URE) --当前耐久记录剩余封印点数
str = str + 1
if Elf_URE >= 50 then
Elf_URE = Elf_URE-50
end
SetItemAttr( Item_Traget ,ITEMATTR_VAL_STR ,str )
SetItemAttr( Item_Traget ,ITEMATTR_URE ,Elf_URE )
Else (meaning >=51), do the curse part.
You can:
Decrease the maximum value, eg. math.random (1, 60)
Increase the threshold for positive result (not cursing), eg. if rad<=70 then
Or both!