PDA

View Full Version : PoP races still not showing up, could this be why?


killspree
01-02-2003, 10:17 AM
I noticed that race was changed to int16 in the database recently, so attempted to spawn some mobs with higher race numbers in their respective zones.

I tried spawning Rallos Zek(new model, number 288) in both Plane of War and Plane of Tactics - as well as Fennin Ro in the Plane of Fire.

Neither of them worked when entered into npc_types manually, Rallos showed as race/base race 32, and Fennin as race/base race 28...both were also naked male humans in-game.

So I decided to look into the source, and found this in mob.h:

bool CombatRange(Mob* other);
int8 flag[60];

int16 GetRace() { return race; }
int8 GetGender() { return gender; }
virtual int8 GetBaseRace() { return base_race; }
virtual int8 GetBaseGender() { return base_gender; }
int8 GetDeity() { return deity; }
int8 GetTexture() { return texture; }
int8 GetHelmTexture() { return helmtexture; }
int8 GetClass() { return class_; }
int8 GetLevel() { return level; }
const char* GetName() { return name; }
Mob* GetTarget() { return target; }
void SetTarget(Mob* mob) { target = mob; }
int32 GetHPRatio() { return (int32)((float)cur_hp/max_hp*100); }
bool IsAttackAllowed(Mob *target);
virtual sint32 GetHP() { return cur_hp; }
virtual sint32 GetMaxHP() { return max_hp; }
virtual sint32 CalcMaxHP() { return max_hp = (base_hp + itembonuses->HP + spellbonuses->HP); }

Looking at that, could it be possible that the virtual int8 for baserace is what's keeping higher number races from being used? Seems like anything > 255 can't be used in npc_types, you have to actually go in-game and target the npc then use #race to set it each time they spawn.

fnemo
01-02-2003, 10:36 AM
as far as i know C++, int8 means integer coded on 8 bits ... that means -127 -> 128 if signed and 0 -> 255 if unsigned. So that maye be the problem.

288 > 128 then the computer do 288 - 128 = 160 . This is still > 128 so ... 160 - 128 = 32 ... you got your model 32. That means that you just need to change the type


Just my 2 copper