diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/VC90/90ScriptDev2.vcproj | 10 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/northrend/borean_tundra.cpp | 93 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp | 6 | ||||
-rw-r--r-- | src/game/BattleGround.cpp | 11 | ||||
-rw-r--r-- | src/game/DynamicObject.h | 2 | ||||
-rw-r--r-- | src/game/Language.h | 3 | ||||
-rw-r--r-- | src/game/Level3.cpp | 1 | ||||
-rw-r--r-- | src/game/Spell.cpp | 8 | ||||
-rw-r--r-- | src/game/SpellAuraEffects.cpp | 7 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 4 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 20 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 6 | ||||
-rw-r--r-- | src/game/Unit.cpp | 15 |
13 files changed, 118 insertions, 68 deletions
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 70d9721b719..f989fdb73d4 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="windows-1250"?> <VisualStudioProject ProjectType="Visual C++" - Version="9.00" + Version="9,00" Name="TrinityScript" ProjectGUID="{4295C8A9-79B7-4354-8064-F05FB9CA0C96}" RootNamespace="ScriptDev2" @@ -459,7 +459,7 @@ RelativePath="..\scripts\eastern_kingdoms\loch_modan.cpp" > </File> - <File + <File RelativePath="..\scripts\eastern_kingdoms\redridge_mountains.cpp" > </File> @@ -658,7 +658,7 @@ <Filter Name="Deadmines" > - <File + <File RelativePath="..\scripts\eastern_kingdoms\deadmines\boss_mr_smite.cpp" > </File> @@ -2872,10 +2872,6 @@ RelativePath="..\include\sc_instance.h" > </File> - <File - RelativePath="..\include\sc_item.h" - > - </File> </Filter> <Filter Name="system" diff --git a/src/bindings/scripts/scripts/northrend/borean_tundra.cpp b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp index 99bc3527edb..539240caf8a 100644 --- a/src/bindings/scripts/scripts/northrend/borean_tundra.cpp +++ b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp @@ -533,13 +533,13 @@ enum eJenny struct TRINITY_DLL_DECL npc_jennyAI : public ScriptedAI { - npc_jennyAI(Creature *c) : ScriptedAI(c) {} + npc_jennyAI(Creature* pCreature) : ScriptedAI(pCreature) {} bool setCrateNumber; void Reset() { - if(!setCrateNumber == false) + if(!setCrateNumber) setCrateNumber = true; m_creature->SetReactState(REACT_PASSIVE); @@ -561,19 +561,6 @@ struct TRINITY_DLL_DECL npc_jennyAI : public ScriptedAI DoCast(m_creature, SPELL_DROP_CRATE, true); } - void MoveInLineOfSight(Unit* pWho) - { - if(pWho->GetEntry() == NPC_FEZZIX_GEARTWIST) - { - if(CAST_PLR(m_creature->GetOwner())->GetQuestStatus(QUEST_LOADER_UP) == QUEST_STATUS_INCOMPLETE && m_creature->GetAura(SPELL_CRATES_CARRIED)) - { - DoCast(CAST_PLR(m_creature->GetOwner()), SPELL_GIVE_JENNY_CREDIT, true); // Maybe is not working. - CAST_PLR(m_creature->GetOwner())->CompleteQuest(QUEST_LOADER_UP); - m_creature->DisappearAndDie(); - } - } - } - void UpdateAI(const uint32 diff) { if(setCrateNumber) @@ -582,8 +569,11 @@ struct TRINITY_DLL_DECL npc_jennyAI : public ScriptedAI setCrateNumber = false; } - if (setCrateNumber == false && !m_creature->HasAura(SPELL_CRATES_CARRIED)) + if (!setCrateNumber && !m_creature->HasAura(SPELL_CRATES_CARRIED)) m_creature->DisappearAndDie(); + + if (!UpdateVictim()) + return; } }; @@ -593,7 +583,45 @@ CreatureAI* GetAI_npc_jenny(Creature *pCreature) } /*###### -## npc_npc_nesingwary_trapper +## npc_fezzix_geartwist +######*/ + +struct TRINITY_DLL_DECL npc_fezzix_geartwistAI : public ScriptedAI +{ + npc_fezzix_geartwistAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + void MoveInLineOfSight(Unit* pWho) + { + ScriptedAI::MoveInLineOfSight(pWho); + + if (pWho->GetTypeId() != TYPEID_UNIT) + return; + + if (pWho->GetEntry() == NPC_JENNY && m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + if (Unit* pOwner = pWho->GetOwner()) + { + if (pOwner->GetTypeId() == TYPEID_PLAYER) + { + if (pWho->HasAura(SPELL_CRATES_CARRIED)) + { + pOwner->CastSpell(pOwner, SPELL_GIVE_JENNY_CREDIT, true); // Maybe is not working. + CAST_PLR(pOwner)->CompleteQuest(QUEST_LOADER_UP); + CAST_CRE(pWho)->DisappearAndDie(); + } + } + } + } + } +}; + +CreatureAI* GetAI_npc_fezzix_geartwist(Creature* pCreature) +{ + return new npc_fezzix_geartwistAI(pCreature); +} + +/*###### +## npc_nesingwary_trapper ######*/ enum eNesingwaryTrapper @@ -749,15 +777,18 @@ enum eLurgglbr struct TRINITY_DLL_DECL npc_lurgglbrAI : public npc_escortAI { - npc_lurgglbrAI(Creature* c) : npc_escortAI(c){} + npc_lurgglbrAI(Creature* pCreature) : npc_escortAI(pCreature){} uint32 IntroTimer; uint32 IntroPhase; void Reset() { - IntroTimer = 0; - IntroPhase = 0; + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + IntroTimer = 0; + IntroPhase = 0; + } } void WaypointReached(uint32 i) @@ -825,6 +856,9 @@ struct TRINITY_DLL_DECL npc_lurgglbrAI : public npc_escortAI } else IntroTimer -= diff; } npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; } }; @@ -1795,7 +1829,7 @@ enum Mootoo_the_Younger_Entries QUEST_ESCAPING_THE_MIST =11664 }; bool QuestAccept_npc_mootoo_the_younger(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ +{ if (quest->GetQuestId()==QUEST_ESCAPING_THE_MIST) { switch (pPlayer->GetTeam()) @@ -1818,11 +1852,11 @@ struct TRINITY_DLL_DECL npc_mootoo_the_youngerAI : public npc_escortAI void Reset() { - SetDespawnAtFar(false); + SetDespawnAtFar(false); } void JustDied(Unit* killer) - { + { if (Player* pPlayer=GetPlayerForEscort()) pPlayer->FailQuest(QUEST_ESCAPING_THE_MIST); } @@ -1855,7 +1889,7 @@ struct TRINITY_DLL_DECL npc_mootoo_the_youngerAI : public npc_escortAI if (pPlayer) pPlayer->GroupEventHappens(QUEST_ESCAPING_THE_MIST, m_creature); SetRun(true); - break; + break; } } }; @@ -1880,7 +1914,7 @@ enum Script_Texts_Bonker_Togglevolt }; bool QuestAccept_npc_bonker_togglevolt(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ +{ if (quest->GetQuestId()==QUEST_GET_ME_OUTA_HERE) { switch (pPlayer->GetTeam()) @@ -1913,9 +1947,9 @@ struct TRINITY_DLL_DECL npc_bonker_togglevoltAI : public npc_escortAI if (Player* pPlayer = GetPlayerForEscort()) pPlayer->FailQuest(QUEST_ESCAPING_THE_MIST); } - + void UpdateEscortAI(const uint32 diff) - { + { if (GetAttack() && UpdateVictim()) { if(Bonker_agro==0) @@ -2016,6 +2050,11 @@ void AddSC_borean_tundra() newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "npc_fezzix_geartwist"; + newscript->GetAI = &GetAI_npc_fezzix_geartwist; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name = "npc_nesingwary_trapper"; newscript->GetAI = &GetAI_npc_nesingwary_trapper; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp index f8d78013c27..1355fa5f245 100644 --- a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp @@ -348,17 +348,14 @@ struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI case NPC_TENEBRON: iTextId = SAY_SARTHARION_CALL_TENEBRON; pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); - DoAddAuraToAllHostilePlayers(SPELL_POWER_OF_TENEBRON); break; case NPC_SHADRON: iTextId = SAY_SARTHARION_CALL_SHADRON; pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); - DoAddAuraToAllHostilePlayers(SPELL_POWER_OF_SHADRON); break; case NPC_VESPERON: iTextId = SAY_SARTHARION_CALL_VESPERON; pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); - DoAddAuraToAllHostilePlayers(SPELL_POWER_OF_VESPERON); break; } @@ -685,9 +682,10 @@ struct TRINITY_DLL_DECL dummy_dragonAI : public ScriptedAI DoScriptText(iTextId, m_creature); + m_creature->RemoveOwnedAura(uiSpellId, AURA_REMOVE_BY_DEFAULT); + if (pInstance) { - pInstance->DoRemoveAurasDueToSpellOnPlayers(uiSpellId); // not if solo mini-boss fight if (pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) return; diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 19643a6003e..1828a04fa8a 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -428,16 +428,17 @@ void BattleGround::Update(uint32 diff) { plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); // remove auras with duration lower than 30s - Unit::AuraMap & auraMap = plr->GetOwnedAuras(); - for (Unit::AuraMap::iterator iter = auraMap.begin(); iter != auraMap.end();) + Unit::AuraApplicationMap & auraMap = plr->GetAppliedAuras(); + for (Unit::AuraApplicationMap::iterator iter = auraMap.begin(); iter != auraMap.end();) { - Aura * aura = iter->second; + AuraApplication * aurApp = iter->second; + Aura * aura = aurApp->GetBase(); if (!aura->IsPermanent() && aura->GetDuration() <= 30*IN_MILISECONDS - && aura->IsPositive(plr) + && aurApp->IsPositive() && (!(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)) && (!aura->HasEffectType(SPELL_AURA_MOD_INVISIBILITY))) - plr->RemoveOwnedAura(iter); + plr->RemoveAura(iter); else ++iter; } diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h index de94b5877bd..ff18cdcb261 100644 --- a/src/game/DynamicObject.h +++ b/src/game/DynamicObject.h @@ -58,4 +58,4 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject> int32 m_duration; // for non-aura dynobjects Aura * m_aura; }; -#endif
\ No newline at end of file +#endif diff --git a/src/game/Language.h b/src/game/Language.h index 617b7f8c01d..4ccafe552d7 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -886,7 +886,8 @@ enum TrinityStrings LANG_HEROIC = 5018, LANG_MOUNTABLE = 5019, LANG_NPCINFO_PHASEMASK = 5020, - // Room for more Trinity strings 5021-9999 + LANG_NPCINFO_ARMOR = 5021, + // Room for more Trinity strings 5022-9999 // Used for GM Announcements LANG_GM_BROADCAST = 6613, LANG_GM_NOTIFY = 6614, diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 7aee776c710..203002e1501 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4612,6 +4612,7 @@ bool ChatHandler::HandleNpcInfoCommand(const char* /*args*/) PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid,cInfo->pickpocketLootId,cInfo->SkinLootId); PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId()); PSendSysMessage(LANG_NPCINFO_PHASEMASK, target->GetPhaseMask()); + PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor()); PSendSysMessage(LANG_NPCINFO_POSITION,float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ())); if(const CreatureData* const linked = target->GetLinkedRespawnCreatureData()) if(CreatureInfo const *master = GetCreatureInfo(linked->id)) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 9e1f632ad33..76fa2922d19 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5075,10 +5075,14 @@ SpellCastResult Spell::CheckCast(bool strict) //custom check switch(m_spellInfo->Id) { - case SPELL_TAG_MURLOC_30877: - if (!m_targets.getUnitTarget() || (m_targets.getUnitTarget() && (m_targets.getUnitTarget()->HasAura(SPELL_TAG_MURLOC_30877) || m_targets.getUnitTarget()->GetTypeId() != TYPEID_UNIT || (m_targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT && ((Creature*)m_targets.getUnitTarget())->GetEntry() != 17326 ))))// Tag Murloc, Blacksilt Scout + // Tag Murloc + case 30877: + { + Unit* target = m_targets.getUnitTarget(); + if (!target || target->GetEntry() != 17326) return SPELL_FAILED_BAD_TARGETS; break; + } case 61336: if(m_caster->GetTypeId() != TYPEID_PLAYER || !((Player*)m_caster)->IsInFeralForm()) return SPELL_FAILED_ONLY_SHAPESHIFT; diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index 14161feac2e..1492d586943 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -5681,6 +5681,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo target->RemoveAurasDueToSpell(spellId); break; } + // Tag Murloc + case 30877: + { + // Tag/untag Blacksilt Scout + target->SetEntry(apply ? 17654 : 17326); + break; + } //Summon Fire Elemental case 40133: { diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 309e646edcc..9dbe3aec84d 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -157,10 +157,6 @@ class TRINITY_DLL_SPEC Aura AuraApplication * GetApplicationOfTarget (uint64 const & guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; } bool IsAppliedOnTarget (uint64 const & guid) const { return m_applications.find(guid) != m_applications.end(); } - bool IsPositive(Unit * const target) const { return (GetApplicationOfTarget(target->GetGUID()))->IsPositive(); } - bool GetEffectMask(Unit * const target) const { return (GetApplicationOfTarget(target->GetGUID()))->GetEffectMask(); } - uint8 GetSlot(Unit * const target) const { return (GetApplicationOfTarget(target->GetGUID()))->GetSlot(); } - bool HasEffect(Unit * const target, uint8 eff) const { return (GetApplicationOfTarget(target->GetGUID()))->HasEffect(eff); } void SetNeedClientUpdateForTargets() const; void HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, bool apply); private: diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 147973874bf..24c2ded7321 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3742,11 +3742,15 @@ void Spell::EffectDispel(uint32 i) for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) { Aura * aura = itr->second; + AuraApplication * aurApp = aura->GetApplicationOfTarget(unitTarget->GetGUID()); + if (!aurApp) + continue; + if ((1<<aura->GetSpellProto()->Dispel) & dispelMask) { if(aura->GetSpellProto()->Dispel == DISPEL_MAGIC) { - bool positive = aura->IsPositive(unitTarget) ? (!(aura->GetSpellProto()->AttributesEx & SPELL_ATTR_EX_NEGATIVE)) : false; + bool positive = aurApp->IsPositive() ? (!(aura->GetSpellProto()->AttributesEx & SPELL_ATTR_EX_NEGATIVE)) : false; // do not remove positive auras if friendly target // negative auras if non-friendly target @@ -6812,10 +6816,12 @@ void Spell::EffectDispelMechanic(uint32 i) std::queue < std::pair < uint32, uint64 > > dispel_list; - Unit::AuraMap& Auras = unitTarget->GetOwnedAuras(); - for (Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end(); iter++) + Unit::AuraMap const& auras = unitTarget->GetOwnedAuras(); + for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) { - Aura * aura = iter->second; + Aura * aura = itr->second; + if (!aura->GetApplicationOfTarget(unitTarget->GetGUID())) + continue; if((GetAllSpellMechanicMask(aura->GetSpellProto()) & (1<<(mechanic))) && GetDispelChance(aura->GetCaster(), aura->GetId())) { dispel_list.push(std::make_pair(aura->GetId(), aura->GetCasterGUID() ) ); @@ -7173,10 +7179,14 @@ void Spell::EffectStealBeneficialBuff(uint32 i) for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) { Aura * aura = itr->second; + AuraApplication * aurApp = aura->GetApplicationOfTarget(unitTarget->GetGUID()); + if (!aurApp) + continue; + if ((1<<aura->GetSpellProto()->Dispel) & dispelMask) { // Need check for passive? this - if (!aura->IsPositive(unitTarget) || aura->IsPassive() || aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_NOT_STEALABLE) + if (!aurApp->IsPositive() || aura->IsPassive() || aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_NOT_STEALABLE) continue; bool dispel_charges = aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR_EX7_DISPEL_CHARGES; diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 8faa28b5e8b..98c4273ffde 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -767,7 +767,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con case 50524: // Runic Power Feed return false; case 12042: // Arcane Power - case SPELL_TAG_MURLOC_30877: // Tag Murloc + case 30877: // Tag Murloc return true; } @@ -3807,10 +3807,6 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->AttributesEx5 |= SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY; count++; break; - case SPELL_TAG_MURLOC_30877: - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_NEARBY_ENTRY; - spellInfo->EffectImplicitTargetB[0] = 0; - break; default: break; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 24f8d7d7ba0..ce560a80c8c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2210,9 +2210,9 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff { // Get total damage bonus from auras int32 current_dmg = 0; - std::pair<AuraMap::const_iterator, AuraMap::const_iterator> range = pVictim->GetOwnedAuras().equal_range(44413); - for (AuraMap::const_iterator iter = range.first; iter != range.second; ++iter) - if (AuraEffect const * bonusEff = iter->second->GetEffect(0)) + std::pair<AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator> range = pVictim->GetAppliedAuras().equal_range(44413); + for (AuraApplicationMap::const_iterator iter = range.first; iter != range.second; ++iter) + if (AuraEffect const * bonusEff = iter->second->GetBase()->GetEffect(0)) current_dmg += bonusEff->GetAmount(); int32 new_dmg = (int32)*absorb * aurEff->GetAmount() / 100; @@ -4292,14 +4292,15 @@ void Unit::RemoveArenaAuras(bool onleave) { // in join, remove positive buffs, on end, remove negative // used to remove positive visible auras in arenas - for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();) + for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();) { - Aura const * aura = iter->second; + AuraApplication const * aurApp = iter->second; + Aura const * aura = aurApp->GetBase(); if ( !(aura->GetSpellProto()->AttributesEx4 & (1<<21)) // don't remove stances, shadowform, pally/hunter auras && !aura->IsPassive() // don't remove passive auras && (!(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || !(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNK8)) // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable) - && (aura->IsPositive(this) ^ onleave)) // remove positive buffs on enter, negative buffs on leave - RemoveOwnedAura(iter); + && (aurApp->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave + RemoveAura(iter); else ++iter; } |