Hi guys,
Having a bit of trouble, Not really sure if I'm going about the right way some insight would be great.
So basically what I'm trying to do is
If player enters XY zone and has NOT completed XY quest then
Player will get spell XY casted on them
else
it will check if the player has the debuff and if player does it will remove the debuff.
Just to be clear
QuestID = 50000
ZoneID = 5010
SpellID = 151000
Thanks
Having a bit of trouble, Not really sure if I'm going about the right way some insight would be great.
So basically what I'm trying to do is
If player enters XY zone and has NOT completed XY quest then
Player will get spell XY casted on them
else
it will check if the player has the debuff and if player does it will remove the debuff.
Just to be clear
QuestID = 50000
ZoneID = 5010
SpellID = 151000
Code:
function OnPlayerZoneChange(event, player, newZone, newArea)
if(player:getzoneid() == 5010) then -- If player is in this zone Do
if(player:getqueststatus(50000) = 6) then -- Check if quest is completed
if(player:haspell(151000) == true) then -- If quest was completed check if player still got debuff if true,
Player:RemoveSpell(151000) -- remove debuff
end
else -- if player didnt complete quest
Player:CastSpell(151000)
end
else -- If player is not in zone Do
if(player:haspell(151000) == true) then -- If player has Debuff
Player:RemoveSpell(151000) -- remove debuff
end
end
end
RegisterPlayerEvent( 27, OnPlayerZoneChange ) -- register event
Thanks