these two lua functions always require you to check to see if you have the quest with hasquest first unless you are absolutely sure you already have it
if you dont check and you dont have the quest it will crash the server
I have in testing and so far it is working when these to functions are executed the lua function will check if you have the quest and just return 0 if it doesnt, no more crashes, and as a sid benifit
you do not have to have a if hasquest state prior to using the above functions, which will make our scripts much cleaner
thoughts comments, are welcome, ie there is a situation where this might not work. before i commit
there are other functions as well i just didnt list them
SUG: QuestIsComplete and SetStepComplete + others
Moderator: Team Members
- Ememjr
- Team Member
- Posts: 975
- Joined: Wed Mar 15, 2017 9:41 am
- EQ2Emu Server: Perseverance
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: SUG: QuestIsComplete and SetStepComplete + others
That is fine, I would have thought those functions would check for the quest first to begin with but I guess not.
- Ememjr
- Team Member
- Posts: 975
- Joined: Wed Mar 15, 2017 9:41 am
- EQ2Emu Server: Perseverance
Re: SUG: QuestIsComplete and SetStepComplete + others
Code: Select all
function enter_poi_location(zone, player, location)
if location == 10 then
if HasQuest(player,477) then
SetStepComplete(player,477,1)
end
if HasQuest(player,474) then
SetStepComplete(player,474,2)
end
if HasQuest(player,475) then
SetStepComplete(player,475,3)
end
if HasQuest(player,478) then
SetStepComplete(player,478,1)
end
end
endCode: Select all
function enter_poi_location(zone, player, location)
if location == 10 then
SetStepComplete(player,477,1)
SetStepComplete(player,474,2)
SetStepComplete(player,475,3)
SetStepComplete(player,478,1)
end
endWho is online
Users browsing this forum: No registered users and 0 guests