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 11-09-2010, 01:12 AM
Templus
Sarnak
 
Join Date: Oct 2010
Location: NYC
Posts: 39
Default addloot on spawn?

this doesn't seem to work:

Code:
sub EVENT_SPAWN{
$npc->addloot(119811);
}
i put it into "test.pl" in my zone and #reloadquest and then do #spawn test 1 1 1 1 1 1

but there's no loot on test's corpse...

I've also tried just "addloot" instead of "$npc->addloot" no dice .. as well as both of those variations with addloot(119811,1) no dice

I'm just a myriad of errors aren't i :(

Thanks in advance

EDIT: i can't even get a simple hail function working with my test NPC .. i guess I can't use quests with npcs that I spawn with GM commands? or something? i don't even know :(
Reply With Quote
  #2  
Old 11-09-2010, 02:09 AM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

You have some reading to do son
Reply With Quote
  #3  
Old 11-09-2010, 02:56 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Multiple issues with what you are trying to do. First, the command is used like this:

quest::addloot(itemid,charges); #Adds x-charges of an item to the NPC's loot

As seen on this page from the Wiki:

http://www.eqemulator.net/wiki/wikka...=QuestTutorial

The $npc-> pointers are only used in the quest objects from this page:

http://www.eqemulator.net/wiki/wikka...a=QuestObjects

They are categorized so you can know what type of pointers work with each command. The $npc one works with the NPC or Mob section commands. The $client works with the Client or Mob section. The rest are all in their own sections and don't work with NPC or Client.

Another problem is that quests don't load for an NPC unless it is in the database, and using #spawn doesn't put them into the database until you use "#npcspawn create" on them or something. Once you have created the spawn, you will need to do a repop and maybe even a zone restart (forget if one is required for sure or not offhand) before scripts will load.

Also, many commands have trouble working directly from EVENT_SPAWN due to the NPC being in the middle of the process of being created at that time. I think more work now than what used to work from that event, but if you can't get them to work from EVENT_SPAWN, the easiest work-around is to set a 5 second timer and use EVENT_TIMER to do your script commands.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 11-09-2010, 05:31 PM
Templus
Sarnak
 
Join Date: Oct 2010
Location: NYC
Posts: 39
Default

Tried doing it a number of ways based on the suggestions. Still can't get it working. Oh well :(

Thanks
Reply With Quote
  #5  
Old 11-10-2010, 09:29 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Also, make sure you can #summonitem the item you are trying to add to the loot table. If it is an item you added since your last server restart, the item won't be added in-game until you restart your server completely, as items are all loaded only when the server is first started and never updated after that point.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 07-09-2011, 03:54 PM
mamba700
Fire Beetle
 
Join Date: Oct 2010
Posts: 5
Default Add Defiant Loot on Spawn

Here is an example of adding Crude Defiant in Crushbone to the stock orc_centurion.pl


Code:
#Orc chit-chat
#Revised Angelox 10-23-06
#zone: Crushbone
sub EVENT_COMBAT{ 

 $rand = rand(); 
 
if(($rand < .3)&&($combat_state == 1))  {  quest::say("Death!!  Death to all who oppose the Crushbone orcs!!"); 
 }  
if(($rand > .67)&&($combat_state == 1)) { 
 quest::say("Hail, Emporer Crush!!");
 }  
if(($rand >= .3)  && ($rand <= .67)&&($combat_state == 1))  {  
 quest::say("Fall before the might of Clan Crushbone!!"); 
 }

}

sub EVENT_ATTACK{  quest::say("Centurions!!  Legionnaires!!  Come join the fight!");

}

sub EVENT_DEATH{ 

 quest::say("You shall have all the Crushbone orc legions on your tail for my death!");

}

sub EVENT_TIMER{


 $defiantrand = rand(28);
 $defiantrand = $defiantrand + 50004; 

 $defiantchance = rand(100);

 if ($defiantchance <= 50) { 
  quest::addloot($defiantrand,1); #Adds x-charges of an item to the NPC's loot
 }

quest::stopalltimers();

}


sub EVENT_SPAWN{

   quest::settimer($mytimer,5); 
}
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 10:18 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3