diff --git a/zone/MobAI.cpp b/zone/MobAI.cpp index 6adcc9d44..5d8351087 100644 --- a/zone/MobAI.cpp +++ b/zone/MobAI.cpp @@ -1207,7 +1207,7 @@ void Mob::AI_Process() { cur = GetSpecialAbilityParam(SPECATK_FLURRY, 7); if (cur > 0) - opts.crit_flat = cur; + opts.crit_flat = (float)cur; Flurry(&opts); } @@ -1263,7 +1263,7 @@ void Mob::AI_Process() { cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 7); if(cur > 0) { - opts.crit_flat = cur; + opts.crit_flat = (float)cur; } Rampage(&opts); } @@ -1302,7 +1302,7 @@ void Mob::AI_Process() { cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 7); if(cur > 0) { - opts.crit_flat = cur; + opts.crit_flat = (float)cur; } AreaRampage(&opts); @@ -1912,7 +1912,7 @@ bool NPC::AI_EngagedCastCheck() { // try casting a heal or gate if (!AICastSpell(this, 100, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) { // try casting a heal on nearby - if (!entity_list.AICheckCloseBeneficialSpells(this, 25, MobAISpellRange, SpellType_Heal)) { + if (!entity_list.AICheckCloseBeneficialSpells(this, 25, (float)MobAISpellRange, SpellType_Heal)) { //nobody to heal, try some detrimental spells. if(!AICastSpell(GetTarget(), 20, SpellType_Nuke | SpellType_Lifetap | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff | SpellType_Charm | SpellType_Root)) { //no spell to cast, try again soon. @@ -1947,7 +1947,7 @@ bool NPC::AI_IdleCastCheck() { #endif AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. if (!AICastSpell(this, 100, SpellType_Heal | SpellType_Buff | SpellType_Pet)) { - if(!entity_list.AICheckCloseBeneficialSpells(this, 33, MobAISpellRange, SpellType_Heal | SpellType_Buff)) { + if(!entity_list.AICheckCloseBeneficialSpells(this, 33, (float)MobAISpellRange, SpellType_Heal | SpellType_Buff)) { //if we didnt cast any spells, our autocast timer just resets to the //last duration it was set to... try to put up a more reasonable timer... AIautocastspell_timer->Start(RandomTimer(1000, 5000), false); diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 9afabf917..9e3bf4630 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1339,7 +1339,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne // redundant to have level check here if(newbon->AggroRange == -1 || effect_value < newbon->AggroRange) { - newbon->AggroRange = effect_value; + newbon->AggroRange = (float)effect_value; } break; } @@ -1351,7 +1351,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne // take the one with less range in any case if(newbon->AssistRange == -1 || effect_value < newbon->AssistRange) { - newbon->AssistRange = effect_value; + newbon->AssistRange = (float)effect_value; } break; } @@ -2984,15 +2984,15 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) break; case SE_ChangeFrenzyRad: - spellbonuses.AggroRange = effect_value; - aabonuses.AggroRange = effect_value; - itembonuses.AggroRange = effect_value; + spellbonuses.AggroRange = (float)effect_value; + aabonuses.AggroRange = (float)effect_value; + itembonuses.AggroRange = (float)effect_value; break; case SE_Harmony: - spellbonuses.AssistRange = effect_value; - aabonuses.AssistRange = effect_value; - itembonuses.AssistRange = effect_value; + spellbonuses.AssistRange = (float)effect_value; + aabonuses.AssistRange = (float)effect_value; + itembonuses.AssistRange = (float)effect_value; break; case SE_AttackSpeed: diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 31b7c6e9c..d34968980 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -985,7 +985,7 @@ bool Bot::AI_IdleCastCheck() { uint8 botClass = GetClass(); if(botClass == CLERIC || botClass == PALADIN || botClass == RANGER) { - if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) { + if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, (float)BotAISpellRange, SpellType_Cure)) { if (!AICastSpell(this, 100, SpellType_Heal)) { if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Heal)) { if (!AICastSpell(this, 100, SpellType_Buff)) { @@ -1001,13 +1001,13 @@ bool Bot::AI_IdleCastCheck() { } // Pets class will first cast their pet, then buffs else if(botClass == DRUID || botClass == MAGICIAN || botClass == SHADOWKNIGHT || botClass == SHAMAN || botClass == NECROMANCER || botClass == ENCHANTER || botClass == BEASTLORD || botClass == WIZARD) { - if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) { + if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, (float)BotAISpellRange, SpellType_Cure)) { if (!AICastSpell(this, 100, SpellType_Pet)) { if (!AICastSpell(this, 100, SpellType_Heal)) { - if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Heal)) { + if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, (float)BotAISpellRange, SpellType_Heal)) { if (!AICastSpell(this, 100, SpellType_Buff)) { if (!AICastSpell(GetPet(), 100, SpellType_Heal)) { - if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Buff)) { + if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, (float)BotAISpellRange, SpellType_Buff)) { // } } @@ -1058,7 +1058,7 @@ bool Bot::AI_EngagedCastCheck() { if(botClass == CLERIC) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { if(!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { - if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) { + if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), (float)BotAISpellRange, SpellType_Heal)) { if(!AICastSpell(GetTarget(), mayGetAggro?0:GetChanceToCastBySpellType(SpellType_Nuke), SpellType_Nuke)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_InCombatBuff), SpellType_InCombatBuff)) { //AIautocastspell_timer->Start(RandomTimer(100, 250), false); // Do not give healer classes a lot of time off or your tank's die @@ -1072,7 +1072,7 @@ bool Bot::AI_EngagedCastCheck() { else if(botClass == DRUID) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { if(!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { - if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) { + if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), (float)BotAISpellRange, SpellType_Heal)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_DOT), SpellType_DOT)) { if(!AICastSpell(GetTarget(), mayGetAggro?0:GetChanceToCastBySpellType(SpellType_Nuke), SpellType_Nuke)) { @@ -1089,7 +1089,7 @@ bool Bot::AI_EngagedCastCheck() { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Slow), SpellType_Slow)) { if(!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { - if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) { + if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), (float)BotAISpellRange, SpellType_Heal)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) { if (!AICastSpell(GetPet(), GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { if(!AICastSpell(this, GetChanceToCastBySpellType(SpellType_InCombatBuff), SpellType_InCombatBuff)) { @@ -1110,7 +1110,7 @@ bool Bot::AI_EngagedCastCheck() { else if(botClass == RANGER) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { - if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) { + if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), (float)BotAISpellRange, SpellType_Heal)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_DOT), SpellType_DOT)) { if (!AICastSpell(GetTarget(), mayGetAggro?0:GetChanceToCastBySpellType(SpellType_Nuke), SpellType_Nuke)) { // @@ -1124,7 +1124,7 @@ bool Bot::AI_EngagedCastCheck() { else if(botClass == BEASTLORD) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Slow), SpellType_Slow)) { if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { - if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) { + if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), (float)BotAISpellRange, SpellType_Heal)) { if (!AICastSpell(GetPet(), GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Pet), SpellType_Pet)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_DOT), SpellType_DOT)) { @@ -1152,7 +1152,7 @@ bool Bot::AI_EngagedCastCheck() { else if(botClass == PALADIN) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) { - if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) { + if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), (float)BotAISpellRange, SpellType_Heal)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Nuke), SpellType_Nuke)) { if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_InCombatBuff), SpellType_InCombatBuff)) { // diff --git a/zone/client.cpp b/zone/client.cpp index 6da2d5c8f..64803ec2b 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2938,7 +2938,7 @@ void Client::Message_StringID(uint32 type, uint32 string_id, uint32 distance) sms->unknown8=0; if(distance>0) - entity_list.QueueCloseClients(this,outapp,false,distance); + entity_list.QueueCloseClients(this,outapp,false,(float)distance); else QueuePacket(outapp); safe_delete(outapp); @@ -3004,7 +3004,7 @@ void Client::Message_StringID(uint32 type, uint32 string_id, const char* message if(distance>0) - entity_list.QueueCloseClients(this,outapp,false,distance); + entity_list.QueueCloseClients(this,outapp,false,(float)distance); else QueuePacket(outapp); safe_delete(outapp); @@ -3285,13 +3285,13 @@ float Client::CalcPriceMod(Mob* other, bool reverse) { chaformula = (GetCHA() - 103)*((-(RuleR(Merchant, ChaBonusMod))/100)*(RuleI(Merchant, PriceBonusPct))); // This will max out price bonus. if (chaformula < -1*(RuleI(Merchant, PriceBonusPct))) - chaformula = -1*(RuleI(Merchant, PriceBonusPct)); + chaformula = -1.0f*(RuleI(Merchant, PriceBonusPct)); } else if (GetCHA() < 103) { chaformula = (103 - GetCHA())*(((RuleR(Merchant, ChaPenaltyMod))/100)*(RuleI(Merchant, PricePenaltyPct))); // This will bottom out price penalty. if (chaformula > 1*(RuleI(Merchant, PricePenaltyPct))) - chaformula = 1*(RuleI(Merchant, PricePenaltyPct)); + chaformula = 1.0f*(RuleI(Merchant, PricePenaltyPct)); } } if (factionlvl <= FACTION_INDIFFERENT) // Indifferent or better. @@ -3300,13 +3300,13 @@ float Client::CalcPriceMod(Mob* other, bool reverse) { chaformula = (GetCHA() - 75)*((-(RuleR(Merchant, ChaBonusMod))/100)*(RuleI(Merchant, PriceBonusPct))); // This will max out price bonus. if (chaformula < -1*(RuleI(Merchant, PriceBonusPct))) - chaformula = -1*(RuleI(Merchant, PriceBonusPct)); + chaformula = -1.0f*(RuleI(Merchant, PriceBonusPct)); } else if (GetCHA() < 75) { chaformula = (75 - GetCHA())*(((RuleR(Merchant, ChaPenaltyMod))/100)*(RuleI(Merchant, PricePenaltyPct))); // Faction modifier keeps up from reaching bottom price penalty. if (chaformula > 1*(RuleI(Merchant, PricePenaltyPct))) - chaformula = 1*(RuleI(Merchant, PricePenaltyPct)); + chaformula = 1.0f*(RuleI(Merchant, PricePenaltyPct)); } } } @@ -3839,9 +3839,9 @@ void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) { } else { ts->ZoneID = database.GetZoneID(Spell.teleport_zone); - ts->y = Spell.base[0]; - ts->x = Spell.base[1]; - ts->z = Spell.base[2]; + ts->y = (float)Spell.base[0]; + ts->x = (float)Spell.base[1]; + ts->z = (float)Spell.base[2]; } ts->unknown008 = 0; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 22640dd48..09b15ae21 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1032,7 +1032,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) } // set the boat's position deltas - boat->SetDeltas(ppu->delta_x, ppu->delta_y, ppu->delta_z, ppu->delta_heading); + boat->SetDeltas(ppu->delta_x, ppu->delta_y, ppu->delta_z, (float)ppu->delta_heading); // send an update to everyone nearby except the client controlling the boat EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct)); PlayerPositionUpdateServer_Struct* ppus = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer; @@ -7970,10 +7970,10 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) Mob* gt = entity_list.GetMob(request->charname); if (gt != 0) { foundplayer->success=1; - foundplayer->x=(int32)gt->GetX(); - foundplayer->y=(int32)gt->GetY(); + foundplayer->x=gt->GetX(); + foundplayer->y=gt->GetY(); - foundplayer->z=(int32)gt->GetZ(); + foundplayer->z=gt->GetZ(); foundplayer->zoneID=zone->GetZoneID(); } //Send the packet... diff --git a/zone/corpse.cpp b/zone/corpse.cpp index d18958dbf..24de178f1 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -1861,7 +1861,7 @@ Corpse* ZoneDatabase::LoadPlayerCorpse(uint32 player_corpse_id) { lengths = mysql_fetch_lengths(result); if(row && lengths) { - NewCorpse = Corpse::LoadFromDBData(atoi(row[0]), atoi(row[1]), row[2], (uchar*) row[7], lengths[7], (float)atof(row[3]), atoi(row[4]), atoi(row[5]), atoi(row[6]), row[8],atoi(row[9])==1, atoi(row[10]) != 0); + NewCorpse = Corpse::LoadFromDBData(atoi(row[0]), atoi(row[1]), row[2], (uchar*) row[7], lengths[7], (float)atof(row[3]), (float)atoi(row[4]), (float)atoi(row[5]), (float)atoi(row[6]), (float)row[8],atoi(row[9])==1, atoi(row[10]) != 0); entity_list.AddCorpse(NewCorpse); } mysql_free_result(result); @@ -1894,7 +1894,7 @@ bool ZoneDatabase::LoadPlayerCorpses(uint32 iZoneID, uint16 iInstanceID) { safe_delete_array(query); while ((row = mysql_fetch_row(result))) { lengths = mysql_fetch_lengths(result); - entity_list.AddCorpse(Corpse::LoadFromDBData(atoi(row[0]), atoi(row[1]), row[2], (uchar*) row[7], lengths[7], (float)atof(row[3]), atoi(row[4]), atoi(row[5]), atoi(row[6]), row[8],atoi(row[9])==1, atoi(row[10]) != 0)); + entity_list.AddCorpse(Corpse::LoadFromDBData(atoi(row[0]), atoi(row[1]), row[2], (uchar*) row[7], lengths[7], (float)atof(row[3]), (float)atoi(row[4]), (float)atoi(row[5]), (float)atoi(row[6]), (float)row[8],atoi(row[9])==1, atoi(row[10]) != 0)); } mysql_free_result(result); } diff --git a/zone/entity.cpp b/zone/entity.cpp index b2e4652fb..b21ab13b0 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3089,7 +3089,7 @@ void EntityList::OpenDoorsNear(NPC *who) void EntityList::SendAlarm(Trap *trap, Mob *currenttarget, uint8 kos) { - float val2 = trap->effectvalue * trap->effectvalue; + float val2 = (float)(trap->effectvalue * trap->effectvalue); auto it = npc_list.begin(); while (it != npc_list.end()) { diff --git a/zone/exp.cpp b/zone/exp.cpp index c67b92b07..0f0d57f5e 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -492,7 +492,7 @@ uint32 Client::GetEXPForLevel(uint16 check_level) else mod = 3.1; - float base = (check_levelm1)*(check_levelm1)*(check_levelm1); + float base = (float)(check_levelm1 * check_levelm1 * check_levelm1); mod *= 1000; diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 10c66b730..c93cc02a7 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -53,7 +53,7 @@ void Mob::CheckFlee() { //see if were possibly hurt enough float ratio = GetHPRatio(); - float fleeratio = GetSpecialAbility(FLEE_PERCENT); + float fleeratio = (float)GetSpecialAbility(FLEE_PERCENT); fleeratio = fleeratio > 0 ? fleeratio : RuleI(Combat, FleeHPRatio); if(ratio >= fleeratio) @@ -112,7 +112,7 @@ void Mob::ProcessFlee() { } //see if we are still dying, if so, do nothing - float fleeratio = GetSpecialAbility(FLEE_PERCENT); + float fleeratio = (float)GetSpecialAbility(FLEE_PERCENT); fleeratio = fleeratio > 0 ? fleeratio : RuleI(Combat, FleeHPRatio); if(GetHPRatio() < fleeratio) return; diff --git a/zone/groups.cpp b/zone/groups.cpp index aa50ba2c9..77e22aa72 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1066,7 +1066,7 @@ void Group::HealGroup(uint32 heal_amt, Mob* caster, int32 range) range = 200; float distance; - float range2 = range*range; + float range2 = (float)(range*range); int numMem = 0; @@ -1106,7 +1106,7 @@ void Group::BalanceHP(int32 penalty, int32 range, Mob* caster) int dmgtaken = 0, numMem = 0; float distance; - float range2 = range*range; + float range2 = (float)(range*range); unsigned int gi = 0; for(; gi < MAX_GROUP_MEMBERS; gi++) @@ -1149,7 +1149,7 @@ void Group::BalanceMana(int32 penalty, int32 range, Mob* caster) range = 200; float distance; - float range2 = range*range; + float range2 = (float)(range*range); int manataken = 0, numMem = 0; unsigned int gi = 0; diff --git a/zone/merc.cpp b/zone/merc.cpp index 897a85030..c4fec62c2 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1877,8 +1877,8 @@ bool Merc::AI_EngagedCastCheck() { } break; case HEALER: - if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), MercAISpellRange, SpellType_Heal)) { - if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Buff), MercAISpellRange, SpellType_Buff)) { + if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), (float)MercAISpellRange, SpellType_Heal)) { + if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Buff), (float)MercAISpellRange, SpellType_Buff)) { failedToCast = true; } } @@ -1931,10 +1931,10 @@ bool Merc::AI_IdleCastCheck() { failedToCast = true; break; case HEALER: - if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, MercAISpellRange, SpellType_Cure)) { - if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, MercAISpellRange, SpellType_Heal)) { - if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, MercAISpellRange, SpellType_Resurrect)) { - if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, MercAISpellRange, SpellType_Buff)) { + if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, (float)MercAISpellRange, SpellType_Cure)) { + if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, (float)MercAISpellRange, SpellType_Heal)) { + if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, (float)MercAISpellRange, SpellType_Resurrect)) { + if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, (float)MercAISpellRange, SpellType_Buff)) { failedToCast = true; } } @@ -1943,7 +1943,7 @@ bool Merc::AI_IdleCastCheck() { result = true; break; case MELEEDPS: - if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, MercAISpellRange, SpellType_Buff)) { + if(!entity_list.Merc_AICheckCloseBeneficialSpells(this, 100, (float)MercAISpellRange, SpellType_Buff)) { failedToCast = true; } break; @@ -2531,7 +2531,7 @@ void Merc::CheckHateList() { if(g) { Mob* MercOwner = GetOwner(); if(MercOwner && MercOwner->GetTarget() && MercOwner->GetTarget()->IsNPC() && (MercOwner->GetTarget()->GetHateAmount(MercOwner) || MercOwner->CastToClient()->AutoAttackEnabled()) && IsAttackAllowed(MercOwner->GetTarget())) { - float range = g->HasRole(MercOwner, RolePuller) ? RuleI(Mercs, AggroRadiusPuller) : RuleI(Mercs, AggroRadius); + float range = (float)(g->HasRole(MercOwner, RolePuller) ? RuleI(Mercs, AggroRadiusPuller) : RuleI(Mercs, AggroRadius)); range = range * range; if(MercOwner->GetTarget()->DistNoRootNoZ(*this) < range) { AddToHateList(MercOwner->GetTarget(), 1); @@ -2553,7 +2553,7 @@ void Merc::CheckHateList() { if(groupMember) { if(npc->IsOnHatelist(groupMember)) { if(!hate_list.IsOnHateList(npc)) { - float range = g->HasRole(groupMember, RolePuller) ? RuleI(Mercs, AggroRadiusPuller) : RuleI(Mercs, AggroRadius); + float range = (float)(g->HasRole(groupMember, RolePuller) ? RuleI(Mercs, AggroRadiusPuller) : RuleI(Mercs, AggroRadius)); range *= range; if(npc->DistNoRootNoZ(*this) < range) { hate_list.Add(npc, 1); @@ -4621,9 +4621,9 @@ void Merc::DoClassAttacks(Mob *target) { float HasteModifier = 0; if(GetHaste() > 0) - HasteModifier = 10000 / (100 + GetHaste()); + HasteModifier = (float)(10000 / (100 + GetHaste())); else if(GetHaste() < 0) - HasteModifier = (100 - GetHaste()); + HasteModifier = (float)(100 - GetHaste()); else HasteModifier = 100; diff --git a/zone/mob.cpp b/zone/mob.cpp index 43c681901..1eb9b2f62 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2066,7 +2066,7 @@ void Mob::SetAttackTimer() { continue; if(pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver) { - float temp_wr = ( pi->GetItem()->BagWR / RuleI(Combat, QuiverWRHasteDiv) ); + float temp_wr = (float)( pi->GetItem()->BagWR / RuleI(Combat, QuiverWRHasteDiv) ); if(temp_wr > max_quiver) { max_quiver = temp_wr; diff --git a/zone/npc.cpp b/zone/npc.cpp index 6bde4cce6..e18496e6a 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -147,8 +147,8 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float logging_enabled = NPC_DEFAULT_LOGGING_ENABLED; - pAggroRange = d->aggroradius; - pAssistRange = d->assistradius; + pAggroRange = (float)d->aggroradius; + pAssistRange = (float)d->assistradius; findable = d->findable; trackable = d->trackable; @@ -2005,7 +2005,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *newValue) if(id == "slow_mitigation") { - slow_mitigation = atoi(val.c_str()); + slow_mitigation = (float)atoi(val.c_str()); return; } if(id == "loottable_id") diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 5b993d7ca..eaa9f9d80 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -1868,7 +1868,7 @@ void QuestManager::npcgender(int gender_id) void QuestManager::npcsize(int newsize) { QuestManagerCurrentQuestVars(); - owner->ChangeSize(newsize, true); + owner->ChangeSize((float)newsize, true); } void QuestManager::npctexture(int newtexture) { @@ -1891,7 +1891,7 @@ void QuestManager::playergender(int gender_id) void QuestManager::playersize(int newsize) { QuestManagerCurrentQuestVars(); - initiator->ChangeSize(newsize, true); + initiator->ChangeSize((float)newsize, true); } void QuestManager::playertexture(int newtexture) diff --git a/zone/raids.cpp b/zone/raids.cpp index 11d56bd2f..582e88764 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -470,7 +470,7 @@ void Raid::HealGroup(uint32 heal_amt, Mob* caster, uint32 gid, int32 range) range = 200; float distance; - float range2 = range*range; + float range2 = (float)(range*range); int numMem = 0; unsigned int gi = 0; @@ -516,7 +516,7 @@ void Raid::BalanceHP(int32 penalty, uint32 gid, int32 range, Mob* caster) int gi = 0; float distance; - float range2 = range*range; + float range2 = (float)(range*range); for(; gi < MAX_RAID_MEMBERS; gi++) { @@ -564,7 +564,7 @@ void Raid::BalanceMana(int32 penalty, uint32 gid, int32 range, Mob* caster) range = 200; float distance; - float range2 = range*range; + float range2 = (float)(range*range); int manataken = 0, numMem = 0; int gi = 0; diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 06034727e..8160114e5 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -780,7 +780,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { } } - float range = RangeItem->Range + AmmoItem->Range + 5; //Fudge it a little, client will let you hit something at 0 0 0 when you are at 205 0 0 + float range = (float)(RangeItem->Range + AmmoItem->Range + 5); //Fudge it a little, client will let you hit something at 0 0 0 when you are at 205 0 0 mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range); range *= range; if(DistNoRootNoZ(*GetTarget()) > range) { @@ -1455,7 +1455,7 @@ void NPC::DoClassAttacks(Mob *target) { float HasteModifier = 0; if(GetHaste() > 0) - HasteModifier = 10000 / (100 + GetHaste()); + HasteModifier = (float)(10000 / (100 + GetHaste())); else if(GetHaste() < 0) HasteModifier = (100 - GetHaste()); else @@ -1961,7 +1961,7 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) { Mob *hate_top = who->GetHateMost(); - float level_difference = GetLevel() - who->GetLevel(); + float level_difference = (float)(GetLevel() - who->GetLevel()); //Support for how taunt worked pre 2000 on LIVE - Can not taunt NPC over your level. if ((RuleB(Combat,TauntOverLevel) == false) && (level_difference < 0) || who->GetSpecialAbility(IMMUNE_TAUNT)){ diff --git a/zone/trap.cpp b/zone/trap.cpp index dd52b3dff..b5c1073d2 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -121,11 +121,11 @@ void Trap::Trigger(Mob* trigger) case trapTypeAlarm: if (message.empty()) { - entity_list.MessageClose(trigger,false,effectvalue,13,"A loud alarm rings out through the air..."); + entity_list.MessageClose(trigger,false,(float)effectvalue,13,"A loud alarm rings out through the air..."); } else { - entity_list.MessageClose(trigger,false,effectvalue,13,"%s",message.c_str()); + entity_list.MessageClose(trigger,false,(float)effectvalue,13,"%s",message.c_str()); } entity_list.SendAlarm(this,trigger,effectvalue); @@ -144,7 +144,7 @@ void Trap::Trigger(Mob* trigger) { if ((tmp = database.GetNPCType(effectvalue))) { - NPC* new_npc = new NPC(tmp, 0, x-5+MakeRandomInt(0, 10), y-5+MakeRandomInt(0, 10), z-5+MakeRandomInt(0, 10), MakeRandomInt(0, 249), FlyMode3); + NPC* new_npc = new NPC(tmp, nullptr, x-5+MakeRandomInt(0, 10), (float)(y-5+MakeRandomInt(0, 10)), (float)(z-5+MakeRandomInt(0, 10)), (float)MakeRandomInt(0, 249), FlyMode3); new_npc->AddLootTable(); entity_list.AddNPC(new_npc); new_npc->AddToHateList(trigger,1); @@ -165,7 +165,7 @@ void Trap::Trigger(Mob* trigger) { if ((tmp = database.GetNPCType(effectvalue))) { - NPC* new_npc = new NPC(tmp, 0, x-2+MakeRandomInt(0, 5), y-2+MakeRandomInt(0, 5), z-2+MakeRandomInt(0, 5), MakeRandomInt(0, 249), FlyMode3); + NPC* new_npc = new NPC(tmp, nullptr, (float)(x-2+MakeRandomInt(0, 5)), (float)(y-2+MakeRandomInt(0, 5)), (float)(z-2+MakeRandomInt(0, 5)), (float)(MakeRandomInt(0, 249)), FlyMode3); new_npc->AddLootTable(); entity_list.AddNPC(new_npc); new_npc->AddToHateList(trigger,1); diff --git a/zone/zone.cpp b/zone/zone.cpp index b2def0e72..0f03a59ce 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1930,7 +1930,7 @@ bool Zone::HasGraveyard() { return Result; } -void Zone::SetGraveyard(uint32 zoneid, uint32 x, uint32 y, uint32 z, uint32 heading) { +void Zone::SetGraveyard(uint32 zoneid, float x, float y, float z, float heading) { pgraveyard_zoneid = zoneid; pgraveyard_x = x; pgraveyard_y = y; @@ -2343,7 +2343,7 @@ void Zone::DoAdventureActions() const NPCType* tmp = database.GetNPCType(ds->data_id); if(tmp) { - NPC* npc = new NPC(tmp, 0, ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h, FlyMode3); + NPC* npc = new NPC(tmp, nullptr, (float)ds->assa_x, (float)ds->assa_y, (float)ds->assa_z, (float)ds->assa_h, FlyMode3); npc->AddLootTable(); entity_list.AddNPC(npc); npc->Shout("Rarrrgh!"); diff --git a/zone/zone.h b/zone/zone.h index 1553b72e8..e9e543cc5 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -243,7 +243,7 @@ public: uint8 lootvar; bool HasGraveyard(); - void SetGraveyard(uint32 zoneid, uint32 x, uint32 y, uint32 z, uint32 heading); + void SetGraveyard(uint32 zoneid, float x, float y, float z, float heading); void LoadBlockedSpells(uint32 zoneid); void ClearBlockedSpells(); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 1123076ab..b3ff1f13f 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1293,8 +1293,8 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { tmpNPCType->unique_spawn_by_name = atoi(row[r++]) == 1 ? true : false; tmpNPCType->underwater = atoi(row[r++]) == 1 ? true : false; tmpNPCType->emoteid = atoi(row[r++]); - tmpNPCType->spellscale = atoi(row[r++]); - tmpNPCType->healscale = atoi(row[r++]); + tmpNPCType->spellscale = (float)atoi(row[r++]); + tmpNPCType->healscale = (float)atoi(row[r++]); tmpNPCType->no_target_hotkey = atoi(row[r++]) == 1 ? true : false; // If NPC with duplicate NPC id already in table, @@ -1605,8 +1605,8 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client //tmpNPCType->unique_spawn_by_name = atoi(row[r++]) == 1 ? true : false; //tmpNPCType->underwater = atoi(row[r++]) == 1 ? true : false; //tmpNPCType->emoteid = atoi(row[r++]); - tmpNPCType->spellscale = atoi(row[r++]); - tmpNPCType->healscale = atoi(row[r++]); + tmpNPCType->spellscale = (float)atoi(row[r++]); + tmpNPCType->healscale = (float)atoi(row[r++]); // If NPC with duplicate NPC id already in table, // free item we attempted to add.