Code:
VermithraxAlive = 1;
function Icharyus_On_Gossip(pUnit, event, player)
if(VermithraxAlive == 1) then
pUnit:GossipCreateMenu(12000, player, 0)
pUnit:GossipMenuAddItem(0, "TEXT.", 1, 0)
pUnit:GossipSendMenu(player)
else
pUnit:GossipCreateMenu(12009, player, 0)
pUnit:GossipMenuAddItem(0, "TEXT2.", 1, 0)
pUnit:GossipSendMenu(player)
end
end
function Icharyus_Submenus(pUnit, event, player, id, intid, code)
if( VermithraxAlive == 1 ) then
Icharyus_Submenus_ALIVE(pUnit, event, player, id, intid, code)
else
Icharyus_Submenus_DEAD(pUnit, event, player, id, intid, code)
end
end
function Icharyus_Submenus_ALIVE(pUnit, event, player, id, intid, code)
if (intid==1) then
pUnit:GossipCreateMenu(12001, player, 0)
pUnit:GossipMenuAddItem(0, "TEXT.", 2, 0)
pUnit:GossipSendMenu(player)
end
end
function Icharyus_Submenus_DEAD(pUnit, event, player, id, intid, code)
if( intid==1) then
player:Teleport(1, 5494.641113, -2620.294922, 1480.592651)
pUnit:GossipComplete(player)
end
end
function Vermithrax_OnDeath(pUnit, Event)
VermithraxAlive = 0;
pUnit:Despawn(1,0);
end
function Vermithrax_OnLoad(pUnit, Event)
VermithraxAlive = 1;
end
function Vermithrax_OnAggro(pUnit, Event)
VermithraxAlive = 1
pUnit:SendChatMessage (14, 0, "You will die!")
end
RegisterUnitEvent(99002, 1, "Vermithrax_OnAggro")
RegisterUnitEvent(99002, 4, "Vermithrax_OnDeath")
RegisterUnitEvent(99002, 18, "Vermithrax_OnLoad")
RegisterUnitGossipEvent(98017, 1, "Icharyus_On_Gossip")
RegisterUnitGossipEvent(98017, 2, "Icharyus_Submenus")