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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2015, 07:11 PM
BasketCase209's Avatar
BasketCase209
Fire Beetle
 
Join Date: Feb 2006
Location: California
Posts: 28
Default Using Perl to randomize npc_spell list.

I like to use scripts to randomize npcs so I can use less spots in the npc_types tree. I was combing through the perl reference page looking for how to assign a spell set to an npc. What I was hoping to do is create a generic npc, assign a random race, then depending on the race that is generated to then have the script select a class and the corresponding spell set that goes along with that particular class.
I know how to select a random race and even a npc_faction ID but not how to assign a class or a spell set. I can't seem to find how to do so on the reference page. I was hoping someone could shine some light on this issue.

Much appreciated. =)
Reply With Quote
  #2  
Old 10-18-2015, 09:01 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
$npc->AddAISpell();
$npc->RemoveAISpell();
Look into those functions.
Reply With Quote
  #3  
Old 10-19-2015, 12:01 PM
BasketCase209's Avatar
BasketCase209
Fire Beetle
 
Join Date: Feb 2006
Location: California
Posts: 28
Default

I saw that on the reference page but I decided it wouldn't work because that would only add one spell instead of assigning an npc_spells id.
I was hoping to find a command that would assign a random spell set to the npc.
Thanks for the input, though.
Reply With Quote
  #4  
Old 10-19-2015, 01:07 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Pull down a new source you can now change spell list of an NPC with ModifyNPCStat

example...


Code:
sub EVENT_SPAWN {
	$npc->ModifyNPCStat("npc_spells_id", 3);  #Spawn with spellset 3
}

sub EVENT_SAY {
	#test swapping spell lists
	if($text =~/spells/i) {
		my $new_list = substr($text, 7);
		$npc->ModifyNPCStat("npc_spells_id", $new_list);
	}
}
Reply With Quote
Reply


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