Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2009, 04:42 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

Well, EVENT_SPAWN doesn't work for summoned pets because the script runs before the pet is actually popped so it still looks like the original pet model even though #showstats has the correct id's for race etc. I set a timer in EVENT_SPAWN for 0 and in EVENT_TIMER did the quest::npcrace() stuff and that worked but it was kind of ugly with the original model spawning and then changing.

So it would require almost 40 perl files with 8 lines of code each and 54 database entries in the blocked_spells table to accomplish what 12 lines of C++ code can do, and does better without the spawn glitch. I don't see the perl way as a win, even if it makes the EQemulator more generic.
__________________
The Realm
Reply With Quote
  #2  
Old 05-16-2009, 05:19 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Congdar, if you do ultimately decide to go with those 12 lines of C code, please do a me favor and add a 13th line which will have a Rule to turn this thing OFF
Reply With Quote
  #3  
Old 05-16-2009, 05:30 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Personally, I don't really care either way, as I have never been too interested in the zone. Code would be fine, but I certainly wouldn't want to see a rule get added for a specific zone just to have special pets there or not. We already have well over 100 rules, and I think we should try to have some restraint when adding them. I would be fine with this going into the code, but I am still sure that it could be handled in perl very close to as well as it would be in the code. The race change thing where it can't change it at spawn time kinda sucks, but I don't think it is all that bad.

One thing that could probably stop you from having to create dozens of script files or blocked spell entries would be to simply use a default.pl in there and have it check the race and texture of the NPC when it spawns. If it is one of the pet classes that shouldn't be allowed, it can just depop it and echo the message you want. I never really did PoAir much on Live, so I don't know if there are NPCs that are pet classes that might summon those same pet races that players aren't allowed to summon. If so, then that would be bad, because it would be depoping NPC's pets. But, if players can't use them, I think it is unlikely that NPCs would there.

That should be a very simple script and would probably cover most or all scenarios. Then, the only problem left is that you see a normal air pet for a second before it changes it's race.

I am sure there are probably more advanced ways to handle this through perl without having to do much more work than adding the source. I am just thinking simple.

Again, I don't really care either way, but I do think perl could handle this fairly well.

poair/default.pl
Code:
sub EVENT_SPAWN {

#75 Elemental
#209 Earth Elemental
#210 Air Elemental
#211 Water Elemental
#212 Fire Elemental

  if ($race == 75 && $texture != 3 || $race == 209 || $race == 211 || $race == 212)
    quest::echo(15,"You can only summon Air pets here");
    quest::depop();
  }

  if ($race == 75 && $texture == 3 || $race == 210) {
    #set your timer and do the race change stuff
  }

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 05-16-2009, 09:51 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

I think Congdar made a pretty reasoned argument of why it makes more sense to do this with the code rather than dozens of perl files and lines of database queries. He's shown to know his stuff between both the code and perl scripting with all he's done with the bots, so I'm inclined to believe him when he says it's the best way to code it. If Kayen or anyone else can come along and show a proven, cleaner way of doing it, code or perl or otherwise, then I'm sure he'd be open to it.

I also think Trevius makes a good point that adding code to the source just to support one zone might not be worth all the effort. However, the zone was unique for many reasons, and the behavior of pets there was one of them, and I have to admit I was very excited to see someone wanting to make this the way it should be (per Live; sorry ChaosSlayer). If he's going to take the time to do all the work of coding it simply for the nostalgia factor, I'm going to applaud his effort.

As for making it a rule, I'm sorry, but I don't think one is needed. I realize that many people play on fully customized servers, but I think it's fair to say that the majority of them have played EQ Live before and wouldn't be surprised to see things happening to their pets in that zone, since it's the same thing that happened on Live. If they ask, explain to them that it's hard-coded and you can't change it. I really doubt they're going to want to put your head on a pike for it.
Reply With Quote
  #5  
Old 05-16-2009, 11:52 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Trev you are my only hope to save the emu =)

As a final statement, I like to point out that Trev is correct that whatever specials this zone may have, it i posible that some other zone may have some other kind of special (keep in mind 100+ new zones coming soon in SoF)and its better to design a single system to handle any zone in this, rather than hard code them each individualy.

Think what would have happened if all our quests would be hard coded into source code...

Think would would have happened if all our npcs and items would be hard coded in code.

Think what it was like before people invented DBs - evrything was hard coded, and what a nightmare it was to change anything...
Reply With Quote
  #6  
Old 05-16-2009, 09:34 PM
Yeormom
Discordant
 
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
Default

Quote:
Originally Posted by ChaosSlayerZ View Post
Think what would have happened if all our quests would be hard coded into source code...

Think would would have happened if all our npcs and items would be hard coded in code.
It would run faster.

Quote:
Originally Posted by ChaosSlayerZ View Post
Trev you are my only hope to save the emu =)
I didn't read too much of the text wall but I like this comment.
__________________
Yeorwned
Bane of Life [Custom Classic/PvP]
Reply With Quote
  #7  
Old 05-16-2009, 09:40 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Quote:
Originally Posted by Yeormom View Post
It would run faster.

.

aga, and everytime you would want to have a Gm event and add just one more npc or just 1 tiny little item - you would need to recompile the server
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 04:09 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3