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.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2002, 11:54 AM
neotokyo
Hill Giant
 
Join Date: Oct 2002
Posts: 118
Default FIX: shrink / growth

shrink and growth spells didnt work, because the server failed to remember the size of the Player. also the ChangeSize function didnt mirror EQ in some ways (probably doesnt now too, but its closer to the real stuff than before)

first redefine the ChangeSize function in mob.h:

Quote:
void ChangeSize(float in_size, bool bNoRestriction = false);
the new implementation is in mob.cpp - just replace the old one - we dont need it anymore
Quote:
void Mob::ChangeSize(float in_size = 0, bool bNoRestriction) {

if (!bNoRestriction)
{
// NEOTOKYO: Player and their pets cant be smaller than gnomes ( == size 3)
if (this->IsClient() || this->petid != 0)
if (in_size < 3.0)
in_size = 3.0;

// NEOTOKYO: i thought this would be a good idea
if (this->IsClient() || this->petid != 0)
if (in_size > 15.0)
in_size = 15.0;
}

// NEOTOKYO: Dont get smaller than this - else mobs will be set to default
if (in_size < 1.0)
in_size = 1.0;
// NEOTOKYO: Dont get bigger than this - (kael giants are size 20)
if (in_size > 255.0)
in_size = 255.0;

this->size = in_size;
SendAppearancePacket(29, (int32) in_size);
}
now we need to adapt the calls to this function:
dont worry, its only 3 calls. we need to update the 2 in client.cpp.

Quote:
if (target)
target->ChangeSize(newsize, true);
else
this->ChangeSize(newsize, true);
as you can see, just add true to the 2 calls so GMs can do whatever they want.

the other call can stay the same, but we need to check something first. the 3rd call is in spells.cpp - i think you can figure that one out ;-)
Quote:
case SE_ModelSize: {
// neotokyo: dont shrink NPCs
if (this->IsNPC())
break;
this->ChangeSize(this->GetSize()*(((float)(spells[spell_id].base[i]))/100));
#ifdef SPELL_EFFECT_SPAM
Message(0, "Effect #%i: You cast a Shrink/Grow spell.", i);
#endif
break;
}
then we need to tell the server which size the players are. add these few lines in client_process.cpp (around line 425, after the facial features were assigned)
Quote:
switch (race)
{
case OGRE:
size = 9;break;
case TROLL:
size = 8;break;
case VAHSHIR:
case BARBARIAN:
size = 7;break;
case HUMAN:
case HIGH_ELF:
case ERUDITE:
case IKSAR:
size = 6;break;
case WOOD_ELF:
case DARK_ELF:
case HALF_ELF:
size = 5;break;
case DWARF:
case HALFLING:
size = 4;break;
case GNOME:
size = 3;break;
default:
size = 0;break;
}
voila, now you should be able to use cobalt bracers, shaman spells, etc.
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 05:49 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