View Single Post
  #3  
Old 07-16-2006, 05:24 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

gah, IsBeneficialSpell() is getting messy already.... but I havent seen a better solution, so we deal with it. A minor style thing, please do not use unbracketed {} if's which span more than one line, it can make code tricky to read.

I ended up rewritting a lot of the code to accomplish two things:
- Instead of checking for specific spell IDs in the temp pet function, I extended the temp pet interface to allow for the flexibility needed for this usage. (I disagreed with your statement that we do not set the eye's owner, did you have a concrete reason for doing that?)
- You have to be careful with memory when you create new NPCType objects, as the ones from database.GetNPCType come from shared memory, and you allocated a new one on the heap, you have to make sure to tell the NPC object about that. Look at the code to see the details.

SQL syntax fixed (same errors as last time), and ID changed for PEQ. BTW, the "official" raneg of IDs for pets is between 500 and 999.

Code:
INSERT INTO aa_swarmpets (spell_id, `count`, npc_id, duration) VALUES (	323,1,644,0);
INSERT INTO aa_swarmpets (spell_id, `count`, npc_id, duration) VALUES (	1720,1,644,0);
INSERT INTO aa_swarmpets (spell_id, `count`, npc_id, duration) VALUES (	960,1,644,0);

INSERT INTO npc_types (id,name,lastname,level,race,class,bodytype,hp,
gender,texture,helmtexture,size,hp_regen_rate,
mana_regen_rate,loottable_id,merchant_id,
npc_spells_id,npc_faction_id,mindmg,maxdmg,
npcspecialattks,aggroradius,face,
luclin_hairstyle,luclin_haircolor,luclin_eyecolor,  
luclin_eyecolor2,luclin_beardcolor,luclin_beard,
fixedz,d_meele_texture1,d_meele_texture2,runspeed,  
MR,CR,DR,FR,PR,see_invis,see_invis_undead,qglobal,  
AC,npc_aggro,spawn_limit,attack_speed,findable,
STR,STA,DEX,AGI,_INT,WIS,CHA)
 VALUES (644,'eye_of_','',1,108,1,63,1,2,0,0,4,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.25,0,0,0,0,0,1,1,0,
0,0,0,0,0,0,0,0,0,0,0,0);
Reply With Quote