SHOW:
|
|
- or go back to the newest paste.
| 1 | local QuestId_Cluck = 3861 | |
| 2 | local NpcChicken = 620 | |
| 3 | local GobIdFarmChickenEgg = 161513 | |
| 4 | ||
| 5 | function OnQuestReward(event, player, creature, quest) | |
| 6 | -- Quest: Cluck! | |
| 7 | if (quest:GetId() == QuestId_Cluck) then | |
| 8 | -- spawn the cleansed plant | |
| 9 | local x, y = creature:GetRelativePoint(math.random()*9, math.random()*math.pi*2); | |
| 10 | - | local x, y, z = creature:GetRelativePoint(math.random()*9, math.random()*math.pi*2); |
| 10 | + | local z = creature:GetMap():GetHeight(x, y) or creature:GetZ() |
| 11 | - | creature:SummonGameObject(GobIdFarmChickenEgg, x, y, z, 0, 30); |
| 11 | + | creature:SummonGameObject(GobIdFarmChickenEgg, x, y, z, 0, 30); |
| 12 | end | |
| 13 | end | |
| 14 | ||
| 15 | RegisterCreatureEvent(NpcChicken, 34, OnQuestReward) -- 34 for creature OnQuestReward event |