Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-09-2002, 09:47 AM
neotokyo
Hill Giant
 
Join Date: Oct 2002
Posts: 118
Default code snippets

this goes into spdat.h right on the bottom of the struct

i left some recognizable code above and below my additions so you'll hopefully know where exactly to place it. it doesnt mean that you have to insert EVERY line, just the lines that werent there before. (original code is italic)

Quote:

int16 ResistDiff;
int16 Spacing3[2];
int16 RecourseLink;
int16 Spacing4[1];
this goes into the zone-servers net.cpp (kinda at the bottom of the Load-function

Quote:
a=0;
for(u=0;u<64;u++)
token[u]=(char)0;
in.get(temp);
while(chrcmpI(&temp,&sep))
{
strncat(token,&temp,1);
a++;
in.get(temp);
}
spells[tempid].SpellAffectIndex=atoi(token);
//cout << spells[tempid].SpellAffectIndex << '^';


a=0;
for(u=0;u<64;u++)
token[u]=(char)0;

for(y=0; y< 23;y++)
{
in.get(temp);
while(chrcmpI(&temp,&sep))
{
strncat(token,&temp,1);
a++;
in.get(temp);
}
spells[tempid].Spacing2[y]=atoi(token);
//cout << spells[tempid].base[y] << '^';
a=0;
for(u=0;u<64;u++)
token[u]=(char)0;
}
in.get(temp);
while(chrcmpI(&temp,&sep))
{
strncat(token,&temp,1);
a++;
in.get(temp);
}
spells[tempid].ResistDiff=atoi(token);
//cout << spells[tempid].ResistDiff << '^';

a=0;
for(u=0;u<64;u++) token[u]=(char)0;

in.get(temp);
for(y=0; y< 2;y++)
{
in.get(temp);
while(chrcmpI(&temp,&sep))
{
strncat(token,&temp,1);
a++;
in.get(temp);
}
spells[tempid].Spacing3[y]=atoi(token);
//cout << spells[tempid].Spacing3[y] << '^';
a=0;
for(u=0;u<64;u++)
token[u]=(char)0;
}


a=0;
for(u=0;u<64;u++) token[u]=(char)0;

in.get(temp);
while(chrcmpI(&temp,&sep))
{
strncat(token,&temp,1);
a++;
in.get(temp);
}
spells[tempid].RecourseLink=atoi(token);

//if (spells[tempid].RecourseLink)
// cerr << " [" << tempid << "]RL = " << spells[tempid].RecourseLink << endl;

a=0;
for(u=0;u<64;u++) token[u]=(char)0;
/*
in.get(temp);
for(y=0; y< 1;y++)
{
in.get(temp);
while(chrcmpI(&temp,&sep))
{
strncat(token,&temp,1);
a++;
in.get(temp);
}
spells[tempid].Spacing4[y]=atoi(token);
//cout << spells[tempid].base[y] << '^';
a=0;
for(u=0;u<64;u++)
token[u]=(char)0;
}*/
while(temp!='\n')
in.get(temp);

//cout << endl;
if(tempid==SPDAT_RECORDS-1) break;
once RecourseLink is successfully recognized and added to the spell-struct we need to do something with it.

this code goes into the spell.cpp Mob::SpellFinished function

Quote:

else if (spell_id == 1948 && (this->IsClient() && (this->CastToClient()->Admin() <= 79))) { // Destroy
// This spell is lame!
}
else {
// if (target->CastToClient()->pp.pvp != NULL && /*TargetSelf*/(target->GetID() == this->GetID()) || /*TargetAlsoPVP*/(target->CastToClient()->pp.pvp == 1 && this->CastToClient()->pp.pvp == 1) || /*TargetPetAlsoPVP*/(target->GetOwner()->CastToClient()->pp.pvp == 1 && this->CastToClient()->pp.pvp == 1) || /*TargetNonPVP*/(target->CastToClient()->pp.pvp == 0 && this->CastToClient()->pp.pvp == 0) || /*TargetPetNonPVP*/(target->GetOwner()->CastToClient()->pp.pvp == 0 && this->CastToClient()->pp.pvp == 0) || /*TargetNPC*/(target->IsNPC())) {
//Message(0, "I dont know that TargetType. 0x%x", spells[spell_id].targettype);

// neotokyo: 09-Nov-02
// Recourse means there is a spell linked to that spell in that the recourse spell will
// be automatically casted on the casters group or the caster only depending on Targettype
if (spells[spell_id].RecourseLink != 0)
{
if (spells[spells[spell_id].RecourseLink].targettype != ST_Self && this->IsClient() && this->CastToClient()->isgrouped && entity_list.GetGroupByClient(this->CastToClient()) != 0)
entity_list.GetGroupByClient(this->CastToClient())->CastGroupSpell(this->CastToClient(),spells[spell_id].RecourseLink);
if (spells[spells[spell_id].RecourseLink].targettype == ST_Self || (this-IsClient() && !this->CastToClient()->isgrouped))
SpellOnTarget(spells[spell_id].RecourseLink,this);
}

switch (spells[spell_id].targettype)
{
case ST_Tap:
and thats about it. i think. hopefully.

PS: i dont have any idea how to tell the board to leave the blanks at the beginning so the code remains readable :-((( think you'll have to prettify it yourself ...
Reply With Quote
 


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