*Cleanup, fix many cases of unoptimized loops, potential crashes, excessively large data types, unnecessary or wrong casts, non-standardized function calls, and so on..
*Proper Maexxna Web Spray locations (old locations sent players flying into the air) --HG-- branch : trunk
This commit is contained in:
1 parent
2b2b2a1d0e
commit
b257a28fa9
34 files changed
+1088
-1120
No files matched your search
+17
-17
@@ -247,38 +247,38 @@ void BattleGroundAV::UpdateScore(uint16 team, int16 points )
|
||||
}
|
||||
}
|
||||
|
||||
Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type )
|
||||
Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
{
|
||||
uint32 level;
|
||||
bool isStatic=false;
|
||||
uint8 level;
|
||||
bool isStatic = false;
|
||||
Creature* creature = NULL;
|
||||
assert(type <= AV_CPLACE_MAX + AV_STATICCPLACE_MAX);
|
||||
if(type>=AV_CPLACE_MAX) //static
|
||||
if (type >= AV_CPLACE_MAX) //static
|
||||
{
|
||||
type-=AV_CPLACE_MAX;
|
||||
cinfoid=int(BG_AV_StaticCreaturePos[type][4]);
|
||||
type -= AV_CPLACE_MAX;
|
||||
cinfoid=uint16(BG_AV_StaticCreaturePos[type][4]);
|
||||
creature = AddCreature(BG_AV_StaticCreatureInfo[cinfoid][0],(type+AV_CPLACE_MAX),BG_AV_StaticCreatureInfo[cinfoid][1],BG_AV_StaticCreaturePos[type][0],BG_AV_StaticCreaturePos[type][1],BG_AV_StaticCreaturePos[type][2],BG_AV_StaticCreaturePos[type][3]);
|
||||
level = ( BG_AV_StaticCreatureInfo[cinfoid][2] == BG_AV_StaticCreatureInfo[cinfoid][3] ) ? BG_AV_StaticCreatureInfo[cinfoid][2] : urand(BG_AV_StaticCreatureInfo[cinfoid][2],BG_AV_StaticCreatureInfo[cinfoid][3]);
|
||||
isStatic=true;
|
||||
level = (BG_AV_StaticCreatureInfo[cinfoid][2] == BG_AV_StaticCreatureInfo[cinfoid][3]) ? BG_AV_StaticCreatureInfo[cinfoid][2] : urand(BG_AV_StaticCreatureInfo[cinfoid][2],BG_AV_StaticCreatureInfo[cinfoid][3]);
|
||||
isStatic = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
creature = AddCreature(BG_AV_CreatureInfo[cinfoid][0],type,BG_AV_CreatureInfo[cinfoid][1],BG_AV_CreaturePos[type][0],BG_AV_CreaturePos[type][1],BG_AV_CreaturePos[type][2],BG_AV_CreaturePos[type][3]);
|
||||
level = ( BG_AV_CreatureInfo[cinfoid][2] == BG_AV_CreatureInfo[cinfoid][3] ) ? BG_AV_CreatureInfo[cinfoid][2] : urand(BG_AV_CreatureInfo[cinfoid][2],BG_AV_CreatureInfo[cinfoid][3]);
|
||||
level = (BG_AV_CreatureInfo[cinfoid][2] == BG_AV_CreatureInfo[cinfoid][3]) ? BG_AV_CreatureInfo[cinfoid][2] : urand(BG_AV_CreatureInfo[cinfoid][2],BG_AV_CreatureInfo[cinfoid][3]);
|
||||
}
|
||||
if(!creature)
|
||||
if (!creature)
|
||||
return NULL;
|
||||
if(creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN][0] || creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
|
||||
if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN][0] || creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
|
||||
creature->SetRespawnDelay(RESPAWN_ONE_DAY); // TODO: look if this can be done by database + also add this for the wingcommanders
|
||||
|
||||
if((isStatic && cinfoid>=10 && cinfoid<=14) || (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid<=AV_NPC_A_GRAVEDEFENSE3) ||
|
||||
(cinfoid>=AV_NPC_H_GRAVEDEFENSE0 && cinfoid<=AV_NPC_H_GRAVEDEFENSE3))))
|
||||
if ((isStatic && cinfoid>=10 && cinfoid<=14) || (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid<=AV_NPC_A_GRAVEDEFENSE3) ||
|
||||
(cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3))))
|
||||
{
|
||||
if(!isStatic && ((cinfoid>=AV_NPC_A_GRAVEDEFENSE0 && cinfoid<=AV_NPC_A_GRAVEDEFENSE3)
|
||||
|| (cinfoid>=AV_NPC_H_GRAVEDEFENSE0 && cinfoid<=AV_NPC_H_GRAVEDEFENSE3)))
|
||||
|| (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3)))
|
||||
{
|
||||
CreatureData &data = objmgr.NewOrExistCreatureData(creature->GetDBTableGUIDLow());
|
||||
data.spawndist = 5;
|
||||
data.spawndist = 5;
|
||||
}
|
||||
//else spawndist will be 15, so creatures move maximum=10
|
||||
//creature->SetDefaultMovementType(RANDOM_MOTION_TYPE);
|
||||
@@ -289,8 +289,8 @@ Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type )
|
||||
//just copied this code from a gm-command
|
||||
}
|
||||
|
||||
if(level != 0)
|
||||
level += m_MaxLevel-60; //maybe we can do this more generic for custom level-range.. actually it's blizzlike
|
||||
if (level != 0)
|
||||
level += m_MaxLevel - 60; //maybe we can do this more generic for custom level-range.. actually it's blizzlike
|
||||
creature->SetLevel(level);
|
||||
return creature;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user