|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
08-18-2008, 04:47 PM
|
Sarnak
|
|
Join Date: Aug 2006
Posts: 60
|
|
Quote:
Originally Posted by Neiv
I'm just now starting to experiment with this. Is the settimer function even necessary in this? Can't I just put the script that appears under the TIMER event under the ENTERZONE event instead? I don't even see an "if($timername eq "check")" statement that would trigger the timer. Or am I just missing something?
|
The point of a looped timer would be so that if faction or whatever changed while players are killing in a zone, they'd be stripped of buffs. Or if their faction takes over, they'd be given the buff. That is why I used a timer in my example.
On the if($timer eq "check") thingy...You can add it. But, you don't have to. if a timer check is not specified (such as in my script under EVENT_TIMER as you mention), it should trigger everything under EVENT_TIMER.
|
|
|
|
08-18-2008, 08:51 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Quote:
Originally Posted by Striat
The point of a looped timer would be so that if faction or whatever changed while players are killing in a zone, they'd be stripped of buffs. Or if their faction takes over, they'd be given the buff. That is why I used a timer in my example. On the if($timer eq "check") thingy...You can add it. But, you don't have to. if a timer check is not specified (such as in my script under EVENT_TIMER as you mention), it should trigger everything under EVENT_TIMER.
|
I see. Thanks. Now that I have it complete it's crashing the zone, so I'm sure I've misinterpreted something. Here is the entire script:
Quote:
sub EVENT_ENTERZONE
##checks is player has item; if so, is added to hate list of NPCID 999243
##if not, checks for kingdom faction
{
if(plugin::check_hasitem($client, 13732))
{
$client->SetPVP(1);
quest::settimer("aggro",20);
}
else
{
quest::settimer("check",1);
}
}
sub EVENT_TIMER
{
if($timername == "aggro")
{
my $guard_one = $entity_list->GetMobByNpcTypeID(999243);
if ($guard_one)
{
my $hate_guard_one = $guard_one->CastToNPC();
$hate_guard_one->AddToHateList($client, 1);
}
quest::stoptimer("aggro");
}
elsif($timername == "check")
{
my $factioncheck = undef;
if ($qglobals{kingdomfaction})
{ #global is defined
# #FactionA
if ($qglobals{kingdomfaction} eq "FactionA")
{ #FactionA has control
$factioncheck = $client->GetCharacterFaction(19927);
if ($factioncheck >= 850)
{ #FactionA and character faction over 850
if (!$client->FindBuff(9000))
{ #No Buff? Then cast
quest::selfcast(9000);
}
}
else
{
if ($client->FindBuff(9000))
{ #Has buff but not enough faction. Fade buff
$client->BuffFadeBySpellID(9000);
}
}
}
# #FactionB faction
elsif ($qglobals{kingdomfaction} eq "FactionB")
{ #FactionB has control
$factioncheck = $client->GetCharacterFaction(19928 ); #space added to prevent emoticon in post, does not appear in script
if ($factioncheck >= 850)
{ #FactionB and character faction over 850
if (!$client->FindBuff(9000))
{ #No Buff? Then cast
quest::selfcast(9000);
}
}
else
{
if ($client->FindBuff(9000))
{ #Has buff but not enough faction. Fade buff
$client->BuffFadeBySpellID(9000);
}
}
}
# #FactionC faction
elsif($qglobals{kingdomfaction} eq "FactionC")
{ #FactionC has control
$factioncheck = $client->GetCharacterFaction(19930);
if ($factioncheck >= 850)
{ #FactionC and character faction over 850
if (!$client->FindBuff(9000))
{ #No Buff? Then cast
quest::selfcast(9000);
}
}
else
{
if ($client->FindBuff(9000))
{ #Has buff but not enough faction. Fade buff
$client->BuffFadeBySpellID(9000);
}
}
}
# #FactionD faction
elsif($qglobals{kingdomfaction} eq "FactionD")
{ #FactionD has control
$factioncheck = $client->GetCharacterFaction(19931);
if ($factioncheck >= 850)
{ #FactionD and character faction over 850
if (!$client->FindBuff(9000))
{ #No Buff? Then cast
quest::selfcast(9000);
}
}
else
{
if ($client->FindBuff(9000))
{ #Has buff but not enough faction. Fade buff
$client->BuffFadeBySpellID(9000);
}
}
}
else
{
if ($client->FindBuff(9000))
{ #Global not set but has buff
$client->BuffFadeBySpellID(9000);
}
}
}
}
}
|
I ran this through a perl cmd line and it returned no errors. But when I put it in the quest/zone folder it crashed the zone. Any thoughts?
|
|
|
|
08-18-2008, 10:13 PM
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
the eqemu_quest_zone_3500.log file might have some clues (3500 would be a different number for you).
|
08-18-2008, 11:10 PM
|
Hill Giant
|
|
Join Date: Jun 2004
Posts: 135
|
|
this code is too messy for me to really see much ><
If the zone is crashing, that's either a loop or a timer issue, and seeing as you have no loops, it's probably your timer.
Then again, considering it only goes once a second, I don't see how this would cause it.. oh well.
I agree, check the log files and that'll dish out some clues.
Also, check the folder size of the logs. If it's a loop or timer issue, it's going to be 300+ megs. Yea, I've had some evil typos in loops and have had 250 gig log folders ;o.... mmm....
Oh well, hope you find what's causing it. If not, put the code up on rafb or something so everyone can see color coding and indents that way your code is not so messy : D.
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
|
08-19-2008, 10:48 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Here's the RAFB URL to the script. You'll notice I placed a quest::emote in the EVENT_ENTERZONE and in the first faction check under the "check" timer. When I enter a zone, I receive the first emote (which tells me it makes it past the point of triggering the timer), but not the second one. By the way, the script no longer crashes the zone. But neither does it cast the buff on my character (char has 1000 faction with FactionA).
|
08-20-2008, 11:06 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
I just reread Striat's original post. So this player.pl is supposed to go in the templates folder?
|
08-21-2008, 11:51 AM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Also . . .
Quote:
Edited--Since you mentioned you haven't really used quest globals, you'd need to have the hand in trigger the "flag". So in your king script when a player turns in the item, you would need to do like a quest::setglobal("kingdomfaction","FactionA",7,"F" ) in your event turn-in where FactionA is the value of the variable (just that it is defined) and 7 is for all players for the variable named kingdomfaction.
|
Is "FactionA" in the function above a reference to the faction number, or is it rather the name I have assigned to the faction in the faction-check script?
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 08:07 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|