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.