Buff Bot re-creation NPC getclass() Help
There is a post on here for an awsome buff bot
http://www.eqemulator.org/forums/showthread.php?t=29401 I am trying to take this a step further but my still growing limit script knowledge is leaving me in the dust. I have a spawngroup cycle that spawns my buff bot. Sometimes it spawns as different classes, so when It spawns I want it to be able to only cast spells from the class it spawned as and with a player(not npc) level check so a level 1 player cannot get clarity 2 because he is too low lvl. I am posting what I have done so far and hoping im on the right track lol. Code:
#Credit goes to Sylaei for the original creation of this buff bot! Thank you Sylaei 08-31-2009 I do not have the level checks placed anywhere because honestly i have no clue where to put the check lol. As always any and all feedback and suggestions appreciated :) Edit: Its having a problem calling the correct spell list. I am pretty sure I cannot call Code:
my $Ench = ($npc->GetClass() == 'Enchanter'); Code:
If ($npc->GetClass() == 'Enchanter') || ($npc->GetClass() == 'Enchanter') |
Why'd you do this?: Shouldn't it be elsif? Just try using the syntax checker, errors below. I pasted exactly what you posted and got those errors, nothing extra, nothing less.
Code:
else ($npc->GetClass == 'Necromancer') { Code:
syntax error at Test.pl line 12, near "else (" Code:
else |
No syntax error with this, haven't tested it in the game, but here you go:
Code:
sub EVENT_SPAWN { |
[QUOTE=Zamthos;218075]Why'd you do this?: Shouldn't it be elsif? Just try using the syntax checker, errors below. I pasted exactly what you posted and got those errors, nothing extra, nothing less.
Code:
else ($npc->GetClass == 'Necromancer') { I tested it with elsif and if neither worked, the NPC doesnt talk so I think im missing a link calling the proper list somewhere down in sub EVENT_SAY but im still tryen to find it lol Here is with 3 class options for more clarification. Code:
sub EVENT_SPAWN { |
Hiya Fig,
Related post about dealing with class types: http://www.eqemulator.org/forums/showthread.php?t=35970 |
Quote:
My problem currently is Having the EVENT_SAY check what class the buffnpc spawned as, then selecting the correct spelllist based on the class. Then all in all, the correct syntax so it works. I am reading your post thoroughly to see if I typed something wrong on calling the classes. TY!!! |
Code:
use 5.012; Code:
I can cast Clarity [174] on you for 50 platinum. |
Awsome c0ncrete!!! I am going to test that out right now! Here is the script me and Ghanja was working on as well. I got the npcs to respond to hail's with the proper class response but calling the correct spell list was not working... lol. Here is that script of a mess.
Code:
use strict; |
No no, ghanja wasn't working on that one bud.
Code:
my $buffs = { Now using the above and the references I pointed out the other night, tie it all together. |
Cool, thanks very much guys, ill work on it for a few days and then update!
|
Code:
use 5.012; change $param{_class} to whatever class you want the npc to be. nyquil is kicking in. you're on your own for a bit... |
Quote:
The NPC is in a spawngroup of multiple classes. So when it dies or respawns, the script will determine which class it spawned as and set the spell list for that class.... $param{_class} = $npc->GetClass(); ? Now by your comment, are you suggesting that I need to change it manually in the script to force a spell list, by the way you have coded it. This is the 1st time I have seen packages and some syntax you are using, I am googling and researching all I can to understand what you have given. Going to need some time to learn all of this lol. Edit: And hash tables |
there is a reason i put the comments about ignoring what was above and below a certain point....
the code within those areas was just put there to emulate the behavior of the script being run via the server. if you were to run this script as it is written from a command prompt, you will see a near identical example of how it would work from inside the game. i was letting you know the things you would need to change if you were running it outside of the game so you could see the different results, depending upon a given scenario (client said / npc class is). to get it to work in the game, you'd remove the lines that are inside the areas designated for you to ignore and change the remaining say lines to quest::say(), $client->Message(), or whatever other message delivery function you would want to use. |
Thank you for explaining, i understand. I have not done any perl outside of eqemu rofl
|
the script you're trying to modify is one of the most convoluted ones i've seen.
also, there's lots of good (and free) reading to be found here: http://www.perl.org/books/library.html |
All times are GMT -4. The time now is 04:37 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.