diff options
author | Shauren <none@none> | 2010-09-12 19:17:58 +0200 |
---|---|---|
committer | Shauren <none@none> | 2010-09-12 19:17:58 +0200 |
commit | e0ffae436c339b7dba3249ba62ca4a3362a6eba7 (patch) | |
tree | 7967bdbac07450eef02c3a69a906af556f32e65c | |
parent | 976cc3f8c4cb23865f92a86651bf063b98304e86 (diff) |
Core/Quests: Fixed remaining issues with quest crediting (note: previous commits did not introduce issues, only revealed them)
Core/DBLayer: Fixed more compile warnings
Core/Spells: Corrected code style from revision 634af79146
Closes issue #3956.
--HG--
branch : trunk
-rw-r--r-- | src/server/game/AI/EventAI/CreatureEventAI.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 31 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/silithus.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Outland/shadowmoon_valley.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Outland/terokkar_forest.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 2 | ||||
-rw-r--r-- | src/server/shared/Database/QueryResult.cpp | 2 | ||||
-rwxr-xr-x | src/server/shared/Database/QueryResult.h | 6 |
9 files changed, 33 insertions, 28 deletions
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index ec0b12a0b42..f7e0fe56392 100644 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -697,13 +697,13 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 case ACTION_T_KILLED_MONSTER: //first attempt player who tapped creature if (Player* pPlayer = me->GetLootRecipient()) - pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, me); + pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, pPlayer); // pPlayer as param is a hacky solution not to use GUID else { //if not available, use pActionInvoker if (Unit* pTarget = GetTargetByType(action.killed_monster.target, pActionInvoker)) if (Player* pPlayer2 = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) - pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, me); + pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, pPlayer); } break; case ACTION_T_SET_INST_DATA: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 23ddd016a0c..7ba3e6b7976 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16117,12 +16117,12 @@ void Unit::SetAuraStack(uint32 spellId, Unit *target, uint32 stack) aura->SetStackAmount(stack); } -void Unit::ApplyResilience(const Unit * pVictim, float * crit, int32 * damage, bool isCrit, CombatRating type) const +void Unit::ApplyResilience(const Unit *pVictim, float *crit, int32 *damage, bool isCrit, CombatRating type) const { if (IsVehicle() || pVictim->IsVehicle()) return; - const Unit * source = ToPlayer(); + const Unit *source = ToPlayer(); if (!source) { source = ToCreature(); @@ -16134,7 +16134,7 @@ void Unit::ApplyResilience(const Unit * pVictim, float * crit, int32 * damage, b } } - const Unit * target = pVictim->ToPlayer(); + const Unit *target = pVictim->ToPlayer(); if (!target) { target = pVictim->ToCreature(); @@ -16145,6 +16145,7 @@ void Unit::ApplyResilience(const Unit * pVictim, float * crit, int32 * damage, b target = target->ToPlayer(); } } + if (!target) return; @@ -16152,29 +16153,35 @@ void Unit::ApplyResilience(const Unit * pVictim, float * crit, int32 * damage, b { case CR_CRIT_TAKEN_MELEE: // Crit chance reduction works against nonpets - if (crit) (*crit) -= target->ToPlayer()->GetMeleeCritChanceReduction(); + if (crit) + *crit -= target->ToPlayer()->GetMeleeCritChanceReduction(); if (source && damage) { - if (isCrit) (*damage) -= target->ToPlayer()->GetMeleeCritDamageReduction((*damage)); - (*damage) -= target->ToPlayer()->GetMeleeDamageReduction((*damage)); + if (isCrit) + *damage -= target->ToPlayer()->GetMeleeCritDamageReduction(*damage); + *damage -= target->ToPlayer()->GetMeleeDamageReduction(*damage); } break; case CR_CRIT_TAKEN_RANGED: // Crit chance reduction works against nonpets - if (crit) (*crit) -= target->ToPlayer()->GetRangedCritChanceReduction(); + if (crit) + *crit -= target->ToPlayer()->GetRangedCritChanceReduction(); if (source && damage) { - if (isCrit) (*damage) -= target->ToPlayer()->GetRangedCritDamageReduction((*damage)); - (*damage) -= target->ToPlayer()->GetRangedDamageReduction((*damage)); + if (isCrit) + *damage -= target->ToPlayer()->GetRangedCritDamageReduction(*damage); + *damage -= target->ToPlayer()->GetRangedDamageReduction(*damage); } break; case CR_CRIT_TAKEN_SPELL: // Crit chance reduction works against nonpets - if (crit) (*crit) -= target->ToPlayer()->GetSpellCritChanceReduction(); + if (crit) + *crit -= target->ToPlayer()->GetSpellCritChanceReduction(); if (source && damage) { - if (isCrit) (*damage) -= target->ToPlayer()->GetSpellCritDamageReduction((*damage)); - (*damage) -= target->ToPlayer()->GetSpellDamageReduction((*damage)); + if (isCrit) + *damage -= target->ToPlayer()->GetSpellCritDamageReduction(*damage); + *damage -= target->ToPlayer()->GetSpellDamageReduction(*damage); } break; default: diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a4c856d95ba..55262de5ff6 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -763,10 +763,8 @@ public: if (owner->GetTypeId() == TYPEID_PLAYER) { if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) - { - //CAST_CRE(who)->CastSpell(owner, 52517, true); - CAST_PLR(owner)->KilledMonsterCredit(GHOULS, me->GetGUID()); - } + CAST_CRE(who)->CastSpell(owner, 52517, true); + //Todo: Creatures must not be removed, but, must instead // stand next to Gothik and be commanded into the pit // and dig into the ground. diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 884913c17ff..19f5ba38618 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -166,7 +166,7 @@ public: case GOSSIP_ACTION_INFO_DEF + 6: pPlayer->SEND_GOSSIP_MENU(7761, pCreature->GetGUID()); //'kill' our trigger to update quest status - pPlayer->KilledMonsterCredit(TRIGGER_RUTGAR, pCreature->GetGUID()); + pPlayer->KilledMonsterCredit(TRIGGER_RUTGAR, 0); break; case GOSSIP_ACTION_INFO_DEF + 9: @@ -192,7 +192,7 @@ public: case GOSSIP_ACTION_INFO_DEF + 14: pPlayer->SEND_GOSSIP_MENU(7767, pCreature->GetGUID()); //'kill' our trigger to update quest status - pPlayer->KilledMonsterCredit(TRIGGER_FRANKAL, pCreature->GetGUID()); + pPlayer->KilledMonsterCredit(TRIGGER_FRANKAL, 0); break; } return true; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 576913629e8..05836408c81 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -151,7 +151,7 @@ public: if (Player* pPlr = Unit::GetPlayer(*me, uiPlayerGUID)) { - pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, me->GetGUID()); + pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, 0); if (GameObject* pGo = pPlr->FindNearestGameObject(GO_CARCASS, 10)) pGo->Delete(); @@ -395,7 +395,7 @@ public: { Player* plr = Unit::GetPlayer(*me, PlayerGUID); if (plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE) - plr->KilledMonsterCredit(23209, me->GetGUID()); + plr->KilledMonsterCredit(23209, 0); } PoisonTimer = 0; me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index ab9eb43f891..d95d9f84bb0 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -319,7 +319,7 @@ public: if (rand()%100 < 25) { me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, me->GetGUID()); + CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, 0); } else me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 20ee4dda01b..34f85a1ac54 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -361,7 +361,7 @@ public: if(Creature* pTarget = GetHitCreature()) { pPlayer->CastSpell(pPlayer, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL); - pPlayer->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, pTarget->GetGUID()); + pPlayer->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, 0); pTarget->ForcedDespawn(); } } diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp index 18866e49fac..f2350df9e6d 100644 --- a/src/server/shared/Database/QueryResult.cpp +++ b/src/server/shared/Database/QueryResult.cpp @@ -105,7 +105,7 @@ enum Field::DataTypes ResultSet::ConvertNativeType(enum_field_types mysqlType) c } } -void ResultBind::BindResult(uint32& num_rows) +void ResultBind::BindResult(uint64& num_rows) { FreeBindBuffer(); diff --git a/src/server/shared/Database/QueryResult.h b/src/server/shared/Database/QueryResult.h index 3aef0d13a5a..096c562b33c 100755 --- a/src/server/shared/Database/QueryResult.h +++ b/src/server/shared/Database/QueryResult.h @@ -114,7 +114,7 @@ class ResultBind CleanUp(); // Clean up buffer } - void BindResult(uint32& num_rows); + void BindResult(uint64& num_rows); protected: MYSQL_BIND* m_rBind; @@ -228,8 +228,8 @@ class PreparedResultSet } ResultBind* rbind; - uint32 row_position; - uint32 num_rows; + uint64 row_position; + uint64 num_rows; }; typedef ACE_Refcounted_Auto_Ptr<PreparedResultSet, ACE_Null_Mutex> PreparedQueryResult; |