• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua @Expert scripters<Check please>

Fare

Advanced OT User
Joined
Apr 3, 2008
Messages
2,387
Reaction score
151
Location
Ukraine
Hello everyone, I want to know, is there any way to make something like:
PHP:
local combatwarrior = createCombatObject()
setCombatParam(combatwarrior, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combatwarrior, COMBAT_PARAM_AGGRESSIVE, 0)

local conditionwarrior = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionwarrior, CONDITION_PARAM_TICKS, rand_time)


function onCastSpell(cid, var)
rand_time = math.random(600000,1200000)
return doCombat(cid, combatwarrior, var)
end

I mean, so there will be random ticks, every spell cast.
I have tried everything, and cannot make it work. So, any ideas?

1)If we make this way, it will be rand_time = 0 when you casting spell
2)If declare rand_time = math.random(600000,1200000) before condition, it will be random, but it will be costant until I reload spells
3)Even if declare rand_time as global, and globaleven which will randomize, it's don't work....


Any ideas? xD
 
Last edited:
thats why I posted here ;D

sorry for this bump, but I really hope someone will join my problem ^^ cuz I'm fucking tired, can't make it works...
 
Last edited by a moderator:
look, this way:

PHP:
local combatwarrior = createCombatObject() 
setCombatParam(combatwarrior, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) 
setCombatParam(combatwarrior, COMBAT_PARAM_AGGRESSIVE, 0) 

local conditionwarrior = createConditionObject(CONDITION_ATTRIBUTES) 
setConditionParam(conditionwarrior, CONDITION_PARAM_TICKS, rand_time) 


function onCastSpell(cid, var) 
rand_time = math.random(600000,1200000) 
return doCombat(cid, combatwarrior, var) 
end

it MUST be random duration of condition, on every spell cast, see this part "setConditionParam(conditionwarrior, CONDITION_PARAM_TICKS, rand_time) " "rand_time = math.random(600000,1200000) "? xD But is doesn't work, as I explained before...
 
/reload scriptname
?
:D

haha) nop, it's not possible ;>


Or, is there any way to declare rand_time in global, and then change it with globalevent, math.random..? Or declare in globalevent, so it will renew every "interval"?


edit. tried everything =\ I guess only 1 way is to make globalevent which will reload all spells every 20 mins...


nvm, remaked as talkaction, which will reload talkactions on every spell use... sux, but I guess, there is noother way...atleast reload talkactions is better then reload spells
 
Last edited:
I'm just a noob in scripting but I think you should declare rand_time above the actual function where it is needed.I might be completely wrong but may be worth a try.
 
Thanks for trying, but as I already said, when I declaring above the function, then it goes to be loaded once, just when server start and it's constant every spell cast, and I need manually reload spells(or talkactions, thats how I made it now) to get next random value ^^
 
Back
Top