|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |

07-19-2008, 10:54 AM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
you won't need to signal them - specialy since signaling does not work zone to zone
you simply have vicars to check for same global variable flag as king would
|

07-19-2008, 12:30 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Quote:
you won't need to signal them - specialy since signaling does not work zone to zone. you simply have vicars to check for same global variable flag as king would
|
How would I go about creating this flag?
|

07-20-2008, 01:26 AM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
by flag I mean global variable, which I belive you allready using for your event with King, no?
|
 |
|
 |

07-20-2008, 11:41 PM
|
Sarnak
|
|
Join Date: Aug 2006
Posts: 60
|
|
easiest way is probably to use player quest and a spell. For example, call if blessing of the kings with the stat buff. then, have it check for faction and/or global. With a global of "FactionA" (triggered with the turn in), but also the option of having FactionB and FactionC(not triggered), let the spell = 9000 in this example and faction_id = 600, 601, and 602 respectively:
player.pl in template folder
Code:
sub EVENT_ENTERZONE {
quest::settimer("check",1);
}
sub EVENT_TIMER {
my $factioncheck = undef;
if ($qglobals{kingdomfaction} ) { #global is defined
if ($qglobals{kingdomfaction} eq "FactionA") { #FactionA has control
$factioncheck = $client->GetCharacterFaction(600);
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);
}
}
}
elsif ($qglobals{kingdomfaction} eq "FactionB") {
$factioncheck = $client->GetCharacterFaction(601);
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);
}
}
}
elsif($qglobals{kingdomfaction} eq "FactionC") {
$factioncheck = $client->GetCharacterFaction(602);
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);
}
}
}
}
else {
if ($client->FindBuff(9000)) { #Global not set but has buff
$client->BuffFadeBySpellID(9000);
}
}
}
Variations could also be used such as checking a player's global value (pledging alliance to a kingdom) or for an item. Several possibilities. If that doesn't work for you, let me know.
Another possibility is to use the quest::setstat command (I think that is it), but that could be more tricky.
The other possibility that I know of would simply be using a database query and updating values in the quest script (or adding a command). I really do not think that is optimal. It'd have the query in it though as UPDATE character format for typical sql update. I think you'd have to update blob file so could be a tad bit tricky. If you really really wanted to do it this way, let me know and I'll help you;p I do suggest one of the other methods though.
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.
|
 |
|
 |

07-22-2008, 07:30 AM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Thanks again. Will try this out.
|

07-25-2008, 12:16 AM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Striat,
The spell approach may be a good option if I can put some kind of perma status on it (I have not worked much with spells since no PC on my server will be able to cast them).
Btw, does the concept of pledging to a deity use a different function than granting a ton of faction using quest::faction()?
Quote:
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.
|
I'm not sure I understand all this. I know what the first variable means. What does "F" stand for? And why does "7" stand for players?
|
 |
|
 |

07-25-2008, 08:11 PM
|
Sarnak
|
|
Join Date: Aug 2006
Posts: 60
|
|
Quote:
Originally Posted by Neiv
Striat,
The spell approach may be a good option if I can put some kind of perma status on it (I have not worked much with spells since no PC on my server will be able to cast them).
|
I haven't done a ton of test work lately. I'd recommend you use Bleh and Ailia's spell editor from the forums to make new spells. I believe you can set a function that prevents a buff from being dispelled. Perhaps treating it as a debuff. To be honest, however, I am not completely sure off the top of my head. I just know it can be done without too much trouble. To do this, you'll have to distribute your custom spells_us.txt file to your players.
That said, what my player.pl script really does is check to see if a player should have the buff. If it doesn't it'll immediately strip the buff. If the player doesn't have the buff (say they log in and their faction has taken over), they will receive the buff.
Quote:
Originally Posted by Neiv
Btw, does the concept of pledging to a deity use a different function than granting a ton of faction using quest::faction()?
|
Quote:
Originally Posted by Neiv
I'm not sure I understand all this. I know what the first variable means. What does "F" stand for? And why does "7" stand for players?
|
F stands for forever. So, the global will last forever or until it is replaced by a different value. 7 refers to the global table at the bottom of http://www.eqemulator.net/wiki/wikka...=QuestTutorial. 7 corresponds to npcid-all,player-all,zone-all. This means the global is set to the given value for all npcs, all zones, and all players.
|
 |
|
 |
 |
|
 |

08-17-2008, 12:21 AM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Quote:
Originally Posted by Striat
easiest way is probably to use player quest and a spell. For example, call if blessing of the kings with the stat buff. then, have it check for faction and/or global. With a global of "FactionA" (triggered with the turn in), but also the option of having FactionB and FactionC(not triggered), let the spell = 9000 in this example and faction_id = 600, 601, and 602 respectively:
player.pl in template folder
Code:
sub EVENT_ENTERZONE {
quest::settimer("check",1);
}
sub EVENT_TIMER {
my $factioncheck = undef;
if ($qglobals{kingdomfaction} ) { #global is defined
if ($qglobals{kingdomfaction} eq "FactionA") { #FactionA has control
$factioncheck = $client->GetCharacterFaction(600);
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);
}
}
}
elsif ($qglobals{kingdomfaction} eq "FactionB") {
$factioncheck = $client->GetCharacterFaction(601);
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);
}
}
}
elsif($qglobals{kingdomfaction} eq "FactionC") {
$factioncheck = $client->GetCharacterFaction(602);
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);
}
}
}
}
else {
if ($client->FindBuff(9000)) { #Global not set but has buff
$client->BuffFadeBySpellID(9000);
}
}
}
|
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?
|
 |
|
 |

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?
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
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 11:02 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |