Originally Posted by
ilikepiehehe
Could u possibly give me a example of that used in a script so i can better understand it?
Code:
function OnQuestAccept(event, pPlayer, questId, pQuestGiver)
if (questId == 5) then
pQuestGiver:SendChatMessage(12,0,"Moo.")
elseif (questId == 6) then
pPlayer:SetPhase(2)
end
end
RegisterServerHook(14, "OnQuestAccept")
And:
Code:
function DREADMAUL_CHECKSPAWN(pUnit,Event)
pUnit:RegisterEvent("DREADMAUL_CHECKPLR", 1000, 0)
end
function DREADMAUL_CHECKPLR(pUnit)
local player = pUnit:GetClosestPlayer()
if player and pUnit:GetDistanceYards(player) < 10 and player:HasQuest(10) and (player:GetQuestObjectiveCompletion(10, 0) == 0) then
player:AdvanceQuestObjective(10, 0)
end
end
RegisterUnitEvent(33742, 18, "DREADMAUL_CHECKSPAWN")