Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

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

Reply
 
Thread Tools Display Modes
  #16  
Old 09-20-2009, 01:54 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by nightsta69 View Post
so basically what your saying is, for this to work, I have to go through every zone and place my level up script in each player.pl? that'll completely defeat the purpose of what i'm tryin to do. i'm tryin to make something similar to the achievement styles of wow. including leveling, mob slaying, and several other things, which requires the use of quest globals and things such as this. if I have to put my scripts into each and every zone player.pl, that'll be WAY to much work. is there any way of changing the source to read from both? or what is stopping it from using both scripts?
No, as long as there isn't already a file named player.pl in your zone folders, they will use the one put in the templates folder. But, again, I think you may need to restart the server for changes to the quest files in the template folder to take effect. You might want to do a search in your quest folder for any files named player.pl to see if there are any in certain zones you might want to use your system in. If so, you either need to remove them, or add your script pieces to the existing files there.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #17  
Old 09-20-2009, 02:11 AM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default

Couldn't you also take the templates/player.pl file and add conditions in each event on the player's location, and if their location match up paste in the /zone/player.pl code?

__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #18  
Old 09-20-2009, 07:07 AM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

Quote:
Originally Posted by Shin Noir View Post
Some quest coder should help me out here.. I'm not very familiar with it. :/ but!
LoadPlayerScript() function in embparser.cpp
it does this whole..
Code:
string filename= "quests/";
	filename += zone;
	filename += "/player.pl";
	string packagename = "player";
	packagename += "_";
	packagename += zone;
build of the quests\zone\player.pl directory.. tries to eval it
Code:
try {
		perl->eval_file(packagename.c_str(), filename.c_str());
	}
then if it doesn't load,
Code:
if(!isloaded(packagename.c_str()))
	{
		filename = "quests/";
		filename += QUEST_TEMPLATES_DIRECTORY;
		filename += "/player.pl";
try templates. So if I'm not corrected, if a /<zone>/player.pl exists, it stops the parser from loading /templates/player.pl?
curiousity question, if I were to just take this code, and make it so it loads both player.pl, what would be wrong with that?
Reply With Quote
  #19  
Old 09-21-2009, 03:16 AM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

anyone have a solution for this that doesn't involve copying and pasting into the 20 somethin odd player.pl's in the quest folder? and i'm still wondering what would happen if the source was changed to allow to load both, the player.pl's that are in the zone folders, as well as the templates one.
Reply With Quote
  #20  
Old 09-21-2009, 07:31 AM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default

I would think modifying the source to incorporate this is going to be more involved than it'd take for ya to just go into..
acrylia
airplane
akanon
bothunder
cabeast
cabwest
charasis
dreadlands
erudnext
erudnint
felwithea
felwitheb
freporte
freportn
gfaydark
greatdivide
grobb
halas
hatesfury
kaladima
kaladimb
neriakb
neriakc
nexus
northkarana
oggok
paineel
poair
poinnovation
pojustice
potimea
potimeb
powater
qcat
qey2hh1
qeynos
qeynos2
qrg
rathemtn
rivervale
sharvahl
skyfire
solrotower
templates
thurgadinb
tox
tutorialb
unrest
veeshan

and write conditions checking if the player is in the zone for each event, though it's going to take a while.. I dunno. That is a lot of files, heh.

Technically could edit your source to do this non-quest style, but, that's kind of complicated too. As is you're hitting a block with that limitation of player.pl not being ran on templates\ and each zone.. Don't really have an easy solution. It's going to probably be work no matter what.
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #21  
Old 09-21-2009, 08:30 AM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

ok I know that this might seem kinda stupid. but I took this code

Code:
if(!isloaded(packagename.c_str()))
	{
		filename = "quests/";
		filename += QUEST_TEMPLATES_DIRECTORY;
		filename += "/player.pl";
and just added this one line

Code:
if(!isloaded(packagename.c_str()) || isloaded(packagename.c_str()))
	{
		filename = "quests/";
		filename += QUEST_TEMPLATES_DIRECTORY;
		filename += "/player.pl";
and compiled and now it reads from both files, and it does what I want it to do now lol. I know thats probably a hack and a half, but it works. i've done some testing with it, and have yet to see anything wrong with it. /shrug.
Reply With Quote
  #22  
Old 09-21-2009, 08:54 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

To test, have both player.pl files have an enter zone event. Have the templates file do some emote "A" and the zone file do some emote "B" and see if both run. That's the only conflict I could think of.. both files having the same event.
Reply With Quote
  #23  
Old 09-21-2009, 09:07 AM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

k tried using both sub EVENT_LEVEL_UP and it does the level up from the templates, but NOT from the zone file. so i'm assuming you can't have 2 of the same events, or the one from templates will override the other from the zone. but other then that, I didn't find any other issues.
Reply With Quote
  #24  
Old 09-21-2009, 09:24 AM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default

Also your code above will always return true.
if(!isloaded(packagename.c_str()) || isloaded(packagename.c_str()))

It's like putting if(1), since you're covering the two possible returns of isloaded(), it can either return 1 (which is on the second half) or 0 (which is on the left half).

But yeah. If you do what you just did, you essentially screw all zone-based player.pl files if it's only working off templates.

I may have to peek and see if I can solve the event handling to execute the two different player files. *shrugs*..
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #25  
Old 09-21-2009, 09:56 AM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

Quote:
Originally Posted by Shin Noir View Post
Also your code above will always return true.
if(!isloaded(packagename.c_str()) || isloaded(packagename.c_str()))

It's like putting if(1), since you're covering the two possible returns of isloaded(), it can either return 1 (which is on the second half) or 0 (which is on the left half).

But yeah. If you do what you just did, you essentially screw all zone-based player.pl files if it's only working off templates.

I may have to peek and see if I can solve the event handling to execute the two different player files. *shrugs*..
its still using the zone based files, IE for doors, creating instances, etc etc. only problem is if BOTH the zone, AND the template player.pl has the same event.(IE if both had sub EVENT_LEVEL_UP) then the template will override the zone pl. other then that, the zone pl works as intended. and yea I know i'm basically making it a true statement regardless, my C+ isn't all that great, I was just looking for a work around, and to see if it was even possible.
Reply With Quote
  #26  
Old 09-22-2009, 11:32 AM
Striat_eq
Fire Beetle
 
Join Date: Aug 2009
Location: LA
Posts: 12
Default

Quote:
Originally Posted by nightsta69 View Post
does $client->Message() broadcast worldwide, or just to the client that triggered the event?
The client that triggered.

quest::we(type, "message"); should work. This is world emote.
Reply With Quote
  #27  
Old 09-22-2009, 11:44 AM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

ah there we go, thats what i've been lookin for, thanx alot.
Reply With Quote
  #28  
Old 09-22-2009, 01:06 PM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

Code:
sub EVENT_LEVEL_UP {
	my $maxlvl = 75;
	my @classlist = ("Warrior", "Cleric", "Paladin", "Ranger", "ShadowKnight", "Druid", "Monk", "Bard", "Rogue", "Shaman", "Necromancer", "Wizard", "Magician", "Enchanter", "Beastlord", "Berserker");
	foreach my $curclass (@classlist) {
       if(!defined($qglobals{$curclass."maxlvl"}) && $ulevel == $maxlvl && $curclass eq $class) {
			quest::setglobal($curclass."maxlvl",$name,2,"F");
            quest::we(5,"$name has made the server first level $ulevel $class!");
            return;
	   }
	}
}
here is the completed code for announcments of server first lvl ups. if anyone wants it, have fun! thanks to shin nor and several others in this thread for helping me weed it out, and learn a thing or two! I plan on adding more custom stuff, as I delve deeper into the learning curve of perl, and C++. thanks again everyone.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:01 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3