|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
|
|
|
03-12-2015, 09:57 PM
|
Fire Beetle
|
|
Join Date: Feb 2015
Location: California
Posts: 11
|
|
Player.pl and Player.lua - can they coexist?
I was playing around with global server wide quests last night, and wanted to run a simple test in player.pl to write some text when a character levels up. I named the file global_player.pl and put it in the global quest directory. There is a global_player.lua file in there already. When the character leveled, the text did not display. The code was your example sample player quest code:
sub EVENT_LEVEL_UP {
$client->Message(15, "You've leveled up, you are now $ulevel, perhaps you should go adventure elsewhere now.");
}
My question is, does only one of these files take presidence? I don't want to disturb the .lua file there because it looks like it adds adventure text I would like to see.
The reason for asking is my goal is to have a quest that scribes players spells when they level up. Is player.pl the place to put such a quest? Can someone suggest an alternative?
Thanks!
|
|
|
|
|
|
|
03-12-2015, 10:28 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Quote:
Originally Posted by Twilightmist
I was playing around with global server wide quests last night, and wanted to run a simple test in player.pl to write some text when a character levels up. I named the file global_player.pl and put it in the global quest directory. There is a global_player.lua file in there already. When the character leveled, the text did not display. The code was your example sample player quest code:
sub EVENT_LEVEL_UP {
$client->Message(15, "You've leveled up, you are now $ulevel, perhaps you should go adventure elsewhere now.");
}
My question is, does only one of these files take presidence? I don't want to disturb the .lua file there because it looks like it adds adventure text I would like to see.
The reason for asking is my goal is to have a quest that scribes players spells when they level up. Is player.pl the place to put such a quest? Can someone suggest an alternative?
Thanks!
|
Yes, if there is a LUA equivalent to a particular type of quest file (in your case the global_player) then, it has precedence over PL (perl).
So you have two options. Remove the LUA version (or rename it to, say, global_player.lu$) or learn LUA and use it and/or Perl (though knowing what I stated above).
|
|
|
|
03-13-2015, 06:57 AM
|
Hill Giant
|
|
Join Date: Feb 2013
Posts: 220
|
|
It is a bit of a pain tbh. Global_player is probably the one place where it would be nice if there was some sort of workaround allowing you to somehow use both.
|
03-13-2015, 11:53 AM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Quote:
Originally Posted by dagulus2
It is a bit of a pain tbh. Global_player is probably the one place where it would be nice if there was some sort of workaround allowing you to somehow use both.
|
But why?
/10char
|
03-13-2015, 12:27 PM
|
Fire Beetle
|
|
Join Date: Feb 2015
Location: California
Posts: 11
|
|
Thank you for the answers. I suspected this is what was happening. As to "Why" we would like to use both is because learning Perl is probably enough for a beginner in programming, without having to learn Lua too.
This is a great opportunity to learn some basic programming skills, using a medium I love (Everquest) but it is a little overwhelming at first.
|
03-13-2015, 12:34 PM
|
|
Administrator
|
|
Join Date: Feb 2009
Location: MN
Posts: 2,071
|
|
Quote:
Originally Posted by Twilightmist
Thank you for the answers. I suspected this is what was happening. As to "Why" we would like to use both is because learning Perl is probably enough for a beginner in programming, without having to learn Lua too.
This is a great opportunity to learn some basic programming skills, using a medium I love (Everquest) but it is a little overwhelming at first.
|
Perl is the master race.
|
|
|
|
03-13-2015, 01:14 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Quote:
Originally Posted by Twilightmist
Thank you for the answers. I suspected this is what was happening. As to "Why" we would like to use both is because learning Perl is probably enough for a beginner in programming, without having to learn Lua too.
This is a great opportunity to learn some basic programming skills, using a medium I love (Everquest) but it is a little overwhelming at first.
|
I thought you may have had a technical reason for the request. Something that perhaps some coding assistance may have allowed you to overcome. I understand the "why" now to mean, you would have liked both perl and lua versions to be provided in which to learn from. So.
Here is the (older) Perl global_player.pl:
Code:
sub EVENT_ENTERZONE {
if($ulevel >= 15 && !defined($qglobals{Wayfarer}) && $client->GetStartZone()!=$zoneid && $zoneid !=50 && $zoneid !=12) {
$client->Message(15,"A mysterious voice whispers to you, 'If you can feel me in your thoughts, know this -- something is changing in the world and I reckon you should be a part of it. I do not know much, but I do know that in every home city and the wilds there are agents of an organization called the Wayfarers Brotherhood. They are looking for recruits . . . If you can hear this message, you are one of the chosen. Rush to your home city, or search the West Karanas and Rathe Mountains for a contact if you have been exiled from your home for your deeds, and find out more. Adventure awaits you, my friend.'");
}
}
sub EVENT_COMBINE_SUCCESS
{
if ($recipe_id =~ /^1090[4-7]$/) {
$client->Message(1,
"The gem resonates with power as the shards placed within glow unlocking some of the stone's power. ".
"You were successful in assembling most of the stone but there are four slots left to fill, ".
"where could those four pieces be?"
);
}
elsif ($recipe_id =~ /^10(903|346|334)$/) {
my %reward = (
melee => {
10903 => 67665,
10346 => 67660,
10334 => 67653
},
hybrid => {
10903 => 67666,
10346 => 67661,
10334 => 67654
},
priest => {
10903 => 67667,
10346 => 67662,
10334 => 67655
},
caster => {
10903 => 67668,
10346 => 67663,
10334 => 67656
}
);
my $type = plugin::ClassType($class);
quest::summonitem($reward{$type}{$recipe_id});
quest::summonitem(67704);
$client->Message(1,"Success");
}
}
|
|
|
|
|
|
|
03-13-2015, 01:25 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Actually, now looking at the new global_player.lua, perhaps this code would more closely resemble the way it works:
Code:
sub EVENT_ENTERZONE {
if (($ulevel >= 15) && (!defined($qglobals{Wayfarer}))) {
my @wayfarerzones = [1,2,3,8,9,10,19,22,23,24,29,30,34,35,40,41,42,45,49,52,54,55,60,61,62,67,68,75,82,106,155,202,382,383,392,393,408];
if ($client->GetStartZone()!=$zoneid && $zoneid ~~ @wayfarerzones) {
$client->Message(15,"A mysterious voice whispers to you, 'If you can feel me in your thoughts, know this -- ".
"something is changing in the world and I reckon you should be a part of it. I do not know much, ".
"but I do know that in every home city and the wilds there are agents of an organization called the ".
"Wayfarers Brotherhood. They are looking for recruits . . . If you can hear this message, you are ".
"one of the chosen. Rush to your home city, or search the West Karanas and Rathe Mountains for a ".
"contact if you have been exiled from your home for your deeds, and find out more. Adventure awaits you, my friend.'");
}
}
}
Untested, as every server I've helped with has ripped out the entire WB functionality.
Last edited by ghanja; 03-14-2015 at 12:20 PM..
Reason: Missing ampersand in code
|
|
|
|
03-13-2015, 01:40 PM
|
Fire Beetle
|
|
Join Date: Feb 2015
Location: California
Posts: 11
|
|
Yes, that's exactly the reason! Thanks for the code. I will try it out and let you know.
Hey Akkadius, you work on the EZ server, right? How was the spell scribing when you level implemented there? I thought that was a great feature.
|
03-13-2015, 02:48 PM
|
Fire Beetle
|
|
Join Date: Feb 2015
Location: California
Posts: 11
|
|
Perfect, thanks ghanja!
|
|
|
|
03-14-2015, 05:51 AM
|
Hill Giant
|
|
Join Date: Feb 2013
Posts: 220
|
|
Quote:
Originally Posted by ghanja
Actually, now looking at the new global_player.lua, perhaps this code would more closely resemble the way it works:
Code:
sub EVENT_ENTERZONE {
if ($ulevel >= 15 & !defined($qglobals{Wayfarer})) {
my @wayfarerzones = [1,2,3,8,9,10,19,22,23,24,29,30,34,35,40,41,42,45,49,52,54,55,60,61,62,67,68,75,82,106,155,202,382,383,392,393,408];
if ($client->GetStartZone()!=$zoneid && $zoneid ~~ @wayfarerzones) {
$client->Message(15,"A mysterious voice whispers to you, 'If you can feel me in your thoughts, know this -- ".
"something is changing in the world and I reckon you should be a part of it. I do not know much, ".
"but I do know that in every home city and the wilds there are agents of an organization called the ".
"Wayfarers Brotherhood. They are looking for recruits . . . If you can hear this message, you are ".
"one of the chosen. Rush to your home city, or search the West Karanas and Rathe Mountains for a ".
"contact if you have been exiled from your home for your deeds, and find out more. Adventure awaits you, my friend.'");
}
}
}
Untested, as every server I've helped with has ripped out the entire WB functionality.
|
Brings up the feedback message '[Quests] Possible precedce problem on bitwise & operator at quests/global/global_player.pl line 2.'
|
|
|
|
03-14-2015, 11:48 AM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Quote:
Originally Posted by dagulus2
Brings up the feedback message '[Quests] Possible precedce problem on bitwise & operator at quests/global/global_player.pl line 2.'
|
Put your global_player.pl in code blocks so we can look at it.
|
|
|
|
03-14-2015, 12:10 PM
|
Hill Giant
|
|
Join Date: Feb 2013
Posts: 220
|
|
Currently:
Code:
###EQ20 global_player file, based on code by ghanja, Kingly_Krab, spyyder
sub EVENT_ENTERZONE {
if (quest::istaskcompleted(9999) == 0 && quest::istaskactive(9999) == 0) #Check if completed Task: Welcome to EQ20
{
quest::assigntask(9999); #Force assign Task: Welcome to EQ20
}
if ($ulevel >= 15 & !defined($qglobals{Wayfarer})) {
my @wayfarerzones = [1,2,3,8,9,10,19,22,23,24,29,30,34,35,40,41,42,45,49,52,54,55,60,61,62,67,68,75,82,106,155,202,382,383,392,393,408];
if ($client->GetStartZone()!=$zoneid && $zoneid ~~ @wayfarerzones) {
$client->Message(15,"A mysterious voice whispers to you, 'If you can feel me in your thoughts, know this -- ".
"something is changing in the world and I reckon you should be a part of it. I do not know much, ".
"but I do know that in every home city and the wilds there are agents of an organization called the ".
"Wayfarers Brotherhood. They are looking for recruits . . . If you can hear this message, you are ".
"one of the chosen. Rush to your home city, or search the West Karanas and Rathe Mountains for a ".
"contact if you have been exiled from your home for your deeds, and find out more. Adventure awaits you, my friend.'");
}
}
}
sub EVENT_COMBINE_SUCCESS
{
if ($recipe_id =~ /^1090[4-7]$/) {
$client->Message(1,
"The gem resonates with power as the shards placed within glow unlocking some of the stone's power. ".
"You were successful in assembling most of the stone but there are four slots left to fill, ".
"where could those four pieces be?"
);
}
elsif ($recipe_id =~ /^10(903|346|334)$/) {
my %reward = (
melee => {
10903 => 67665,
10346 => 67660,
10334 => 67653
},
hybrid => {
10903 => 67666,
10346 => 67661,
10334 => 67654
},
priest => {
10903 => 67667,
10346 => 67662,
10334 => 67655
},
caster => {
10903 => 67668,
10346 => 67663,
10334 => 67656
}
);
my $type = plugin::ClassType($class);
quest::summonitem($reward{$type}{$recipe_id});
quest::summonitem(67704);
$client->Message(1,"Success");
}
}
sub EVENT_SAY {
if($text=~/internet/i) {
$client->SendWebLink("https://www.google.com");
}
}
sub EVENT_DISCOVER_ITEM {
$client->Message(335, "You discovered " . quest::varlink($itemid) . "!");
#quest::we("$name discovered " . quest::varlink($itemid) . "!", 335, 1, 0, 0);
#quest::crosszonemessageplayerbyname(335, "$name discovered " . plugin::varlink($itemid) . "!");
}
Feedback message is now on line 8. The feedback message was there before I added the code to assign the task.
|
|
|
|
03-14-2015, 12:19 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Replace line 8 with:
Code:
if (($ulevel >= 15) && (!defined($qglobals{Wayfarer}))) {
I mistyped and had only one ampersand.
|
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 03:32 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|