-
Active Member
[Release] script that rejects, if player havn't the quest
Hey guys
Its been a while since i released anything (<- lazy bastard)
Oh well, i've been making this small script, that checks if the player have completed, or is on a quest, usefull if you want something exclusive, like a place that players cant get to, without the quest completed, or its, like i've used it, to make the quartermaster unavaible until the quest is completed (i know it can be done by the gossip itself, but this's wayy more fancy ;D)
The script is partly inspired by the dalaran guardians
Edit the red, for the quest ID
Edit the blue if you want other teleport coordinates (mapID, X, Y, Z)
Edit the yellow if you want it to higher distance
Edit the ligtgreen if you want another text, when players enters without having the quest, or having it completed, this will be broadcasted in yellow at the players screen, just before the player gets teleported
Edit the white to change the NPC's ID (the one, whom checks wether not players on / done it)
Enjoy and comment 6):
Code:
function GetTeam(Player)
local FacQQ = Player
if (FacQQ:HasFinishedQuest(87400) == true) then
return 1
elseif (FacQQ:CreatureHasQuest(87400) == true) then
return 1
elseif (FacQQ:HasFinishedQuest(87400) == false) then
return 0
end
end
end
print "shieldGuards loaded"
function MageGuard_OnSpawn (pUnit, Event)
pUnit:SetCombatCapable(0)
pUnit:RegisterEvent("MageGuard_Check", 1000, 0)
end
function MageGuard_Check (pUnit, Event)
local plrs = pUnit:GetInRangePlayers()
local plr = pUnit:GetClosestPlayer()
for k, v in pairs (plrs) do
if (pUnit:GetDistance(v) <= 25 or v:IsInBack(pUnit) == true) then
if (pUnit:GetEntry() == 28028) then
if (GetTeam(v) == 0) then
plr:Teleport (0,-7676.068848, 1394.667725, 131.407776)
v:SendBroadcastMessage("You need to complete 'Reporting to Lietenant John' first!")
end
else
if (GetTeam(v) == 1) then
end
end
end
end
end
RegisterUnitEvent(28028, 18, "MageGuard_OnSpawn")
RegisterUnitEvent(28028, 6, "MageGuard_OnSpawn")
~Exa out
Last edited by Exacute; 11-21-2009 at 09:56 AM.
-
Post Thanks / Like - 1 Thanks
hackerlol (1 members gave Thanks to Exacute for this useful post)
-
Banned
-
Active Member
Thanks mate, I just realised the title is wrong, its supposed to be "...if player havn't the quest"
Also i forgot to highlight the NPC changing.. yeah this is really basic.. but am doing it of habbit's anyway
~Ex out
Last edited by Exacute; 11-21-2009 at 09:37 AM.
-
-
Active Member
Haha thanks zero
-
Member
thanks to P1raten
-
-
Active Member
/bow, thanks svedin 'n' wofl
-
Contributor
Could just have a variable so they can use the GetTeam Function more then once and have different quests.
Edit the red for the quest ID
Edit the blue if you want other teleport coordinates (mapID, X, Y, Z)
Edit the yellow if you want it to higher distance
Edit the lightgreen if you want another text, when players enters without having the quest, or having it completed, this will be broadcasted in yellow at the players screen, just before the player gets teleported
Edit the purple to change the NPC's ID (the one, whom checks wether not players on / done it)
Code:
function GetTeam(Player, questID)
local FacQQ = Player
if (FacQQ:HasFinishedQuest(questID) == true) then
return 1
elseif (FacQQ:CreatureHasQuest(questID) == true) then
return 1
elseif (FacQQ:HasFinishedQuest(questID) == false) then
return 0
end
end
end
print "shieldGuards loaded"
function MageGuard_OnSpawn (pUnit, Event)
pUnit:SetCombatCapable(0)
pUnit:RegisterEvent("MageGuard_Check", 1000, 0)
end
function MageGuard_Check (pUnit, Event)
local plrs = pUnit:GetInRangePlayers()
local plr = pUnit:GetClosestPlayer()
for k, v in pairs (plrs) do
if (pUnit:GetDistance(v) <= 25 or v:IsInBack(pUnit) == true) then
if (pUnit:GetEntry() == 28028) then
if (GetTeam(v, 87400) == 0) then
plr:Teleport (0,-7676.068848, 1394.667725, 131.407776)
v:SendBroadcastMessage("You need to complete 'Reporting to Lietenant John' first!")
end
else
if (GetTeam(v, 87400) == 1) then
end
end
end
end
end
RegisterUnitEvent(28028, 18, "MageGuard_OnSpawn")
RegisterUnitEvent(28028, 6, "MageGuard_OnSpawn")
Nom Nom Nom :P
-
Active Member
Im sorry mate, wtf are you saying?
-
Contributor
Lol, i added another argument that allows you to use the GetTeam function with different quests. Ex: You have one area that you need to have quest:12345 done, and you have another area that you need quest 54321 done.
GetTeam(v, 12345) <--- For the first one
GetTeam(v, 54321) < --- For the second one.
Nom Nom Nom :P