Hi guys,
Just wondering if anyone can give me some insight.
What I'm trying to do is if a player has X quest In Y zone they'll get 2 debuffs random debuffs from a list of debuffs
Is it as simple as changing
I don't know if I'm completely wrong with this but Will I have to change the
Bits to be more like
And do this for all of them all combinations.
Any help will be much appreciated or if you know of any forums / Wikis with the explanations on how it works.
Just wondering if anyone can give me some insight.
What I'm trying to do is if a player has X quest In Y zone they'll get 2 debuffs random debuffs from a list of debuffs
Code:
function Quest(event, player, newZone, newArea)
if(player:getzoneid() == Y) then -- Might need to do AreaID here not sure yet
if(player:hasQuest(X) == true then
local chance = math.random(1,8)
if(chance == 1) then
Player:CastSpell(DebuffSpellEnrty))
elseif(chance == 2) then
Player:CastSpell(DebuffSpellEnrty)
elseif(chance == 3) then
Player:CastSpell(DebuffSpellEnrty)
elseif(chance == 4) then
Player:CastSpell(DebuffSpellEnrty)
elseif(chance == 5) then
Player:CastSpell(DebuffSpellEnrty)
elseif(chance == 6) then
Player:CastSpell(DebuffSpellEnrty)
elseif(chance == 7) then
Player:CastSpell(DebuffSpellEnrty)
elseif(chance == 8) then
Player:CastSpell(DebuffSpellEnrty)
end
else
Player:RemoveSpell(DebuffSpellEnrty)
end
else
if(player:haspell(DebuffSpellEnrty) == true) then
Player:RemoveSpell(DebuffSpellEnrty)
end
end
end
Is it as simple as changing
Code:
local chance = math.random([COLOR="#FF0000"]2[/COLOR],8)
Code:
if(chance == 1) then
Player:CastSpell(DebuffSpellEnrty))
Code:
if(chance == 1 or chance == 2) then
Player:CastSpell(DebuffSpell1)
Player:CastSpell(DebuffSpell2))
And do this for all of them all combinations.
Any help will be much appreciated or if you know of any forums / Wikis with the explanations on how it works.