PDA

View Full Version : Seeing is Believing - Multiple Spell Fixes


EverHood
07-14-2006, 10:25 PM
This fixes/implements the following spells:

Cast Sight
Bind Sight
Eye of Zomm
Eye of Tallon
Stalking Probe (Gnomes Rejoice!)

I used #summonitem to grab a tinkered stalking probe and holgresh elder beads and they both right clicked properly.

Here is the Diff:


--- E:\EQEmu827\zone\spdat.h Mon Jul 10 22:43:22 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\spdat.h Sat Jul 15 00:51:00 2006
@@ -29,6 +29,10 @@
#define SPELL_HARM_TOUCH 88
#define SPELL_HARM_TOUCH2 2821
#define SPELL_NPC_HARM_TOUCH 929
+// Everhood
+#define SPELL_EYE_OF_ZOMM 323
+#define SPELL_EYE_OF_TALLON 1720
+#define SPELL_STALKING_PROBE 960


//#define SPDAT_SIZE 1824000
@@ -43,7 +47,7 @@

enum SpellAffectIndex {
SAI_Calm = 12, // Lull and Alliance Spells
- SAI_Dispell = 14,
+ SAI_Dispell_Sight = 14, // Dispells and Spells like Bind Sight
SAI_Memory_Blur = 27,
SAI_Calm_Song = 43 // Lull and Alliance Songs
};
--- E:\EQEmu827\zone\spdat.cpp Mon Jul 10 22:43:22 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\spdat.cpp Sat Jul 15 02:30:50 2006
@@ -211,10 +211,14 @@
// EverHood - These spells are actually detrimental
if(spells[spell_id].goodEffect == 1){
SpellTargetType tt = spells[spell_id].targettype;
- if(tt == ST_Target || tt == ST_AETarget || tt == ST_Animal || tt == ST_Undead)
- if(spells[spell_id].resisttype == RESIST_MAGIC){
int16 sai = spells[spell_id].SpellAffectIndex;
- if(sai == SAI_Calm || sai == SAI_Dispell || sai == SAI_Memory_Blur || sai == SAI_Calm_Song)
+ if(tt == ST_Target || tt == ST_AETarget || tt == ST_Animal || tt == ST_Undead || tt == ST_Pet)
+ if(spells[spell_id].resisttype == RESIST_MAGIC){
+ if(sai == SAI_Calm || sai == SAI_Dispell_Sight || sai == SAI_Memory_Blur || sai == SAI_Calm_Song)
+ return false;
+ }else{
+ // Bind Sight and Cast Sight
+ if(sai == SAI_Dispell_Sight && spells[spell_id].skill == 18)
return false;
}
}
--- E:\EQEmu827\zone\spell_effects.cpp Mon Jul 10 22:43:22 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\spell_effects.cpp Fri Jul 14 22:08:03 2006
@@ -871,8 +871,8 @@
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Eye of Zomm");
#endif
- const char *msg = "Eye of Zomm is not implemented.";
- if(caster) caster->Message(13, msg);
+ if(caster && caster->IsClient())
+ caster->CastToClient()->TemporaryPets(spell_id, this);
break;
}

--- E:\EQEmu827\zone\AA.cpp Thu Jul 13 22:09:56 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\AA.cpp Sat Jul 15 01:07:02 2006
@@ -404,6 +404,13 @@
const AA_SwarmPet &pet = AA_SwarmPets[spell_id];

const NPCType *npc_type = database.GetNPCType(pet.npc_id);
+ // Everhood - Eye Name over rides
+ if(spell_id == SPELL_EYE_OF_ZOMM || spell_id == SPELL_EYE_OF_TALLON || spell_id == SPELL_STALKING_PROBE ){
+ NPCType *npc_type_temp = new NPCType;
+ memcpy(npc_type_temp, npc_type, sizeof(NPCType));
+ strcat(npc_type_temp->name,this->GetName());
+ npc_type = npc_type_temp;
+ }
if(npc_type == NULL) {
//log write
LogFile->write(EQEMuLog::Error, "Unknown npc type for swarm pet spell id: %d", spell_id);
@@ -425,14 +432,24 @@
8, 8, -8, -8 };

while(summon_count > 0) {
+ int pet_duration = 0;
NPC* npca = new NPC(npc_type, 0,
GetX()+swarm_pet_x[summon_count], GetY()+swarm_pet_y[summon_count],
GetZ(), GetHeading());
+ // Everhood - Eye duration over ride
+ if(spell_id == SPELL_EYE_OF_ZOMM || spell_id == SPELL_EYE_OF_TALLON || spell_id == SPELL_STALKING_PROBE ){
+ // we don't own eyes
+ // eyes don't get hate
+ // eyes do have different durations
+ pet_duration = spells[spell_id].buffduration * 6000;
+ }else{
+ pet_duration = pet.duration;
npca->SetOwnerID(GetID());
- entity_list.AddNPC(npca);
if(targ != NULL)
npca->AddToHateList(targ, 1000, 1000);
- npca->StartSwarmTimer(pet.duration);
+ }
+ entity_list.AddNPC(npca);
+ npca->StartSwarmTimer(pet_duration);

summon_count--;
}


And some SQL to back it up:

* Change 189041 in all querys to an npc id of your choice if mine conflicts:


INSERT INTO aa_swarmpets (spell_id, `count`, npc_id, duration) VALUES ( 323,1,189041,0);
INSERT INTO aa_swarmpets (spell_id, `count`, npc_id, duration) VALUES ( 1720,1,189041,0);
INSERT INTO aa_swarmpets (spell_id, `count`, npc_id, duration) VALUES ( 960,1,189041,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 (189041,'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,1.25,0,0,0,0,0,1,1,0,
0,0,0,0,0,0,0,0,0,0,0,0);


On a side note , I'll be posting under this name from now on instead of unicorn97211 so my irc name/server name/forum names all match.

Enjoy :)

mattmeck
07-15-2006, 05:18 AM
Nice work =)

Tell your wife we say Happy Birthday too =)

fathernitwit
07-16-2006, 05:24 PM
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.


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);

EverHood
07-24-2006, 06:18 AM
I didn't want to assign the eye an owner so that if the eye was hit by an AE spell it wouldn't add it's Owner to the AE casters hate list. Nothing that happens to the eye should reflect on the player that cast the eye and I was afraid giving the eye an OwnerID could trip code paths that it shouldn't or doesn't need to.

fathernitwit
07-24-2006, 01:45 PM
well hate works the other way... so theoretically the owner would get the caster of the AE added to its hate list, which would be correct if for some reason an NPC cast the eye, and you killed it... it would be mad at you. I think its better to set the owner and see what comes of it.