From f6b2eb4e5b0aea5e29c7220d97c420d5abeca1b8 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Fri, 26 Dec 2008 20:25:31 +0100 Subject: *Gossips for creature 20907 --HG-- branch : trunk --- .../scripts/zone/netherstorm/netherstorm.cpp | 54 +++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp index 555ffc0b769..8d1c528f7ae 100644 --- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp +++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp @@ -670,11 +670,13 @@ bool AreaTrigger_at_commander_dawnforge(Player *player, AreaTriggerEntry *at) ## npc_protectorate_nether_drake ######*/ +#define GOSSIP_ITEM "I'm ready to fly! Take me up, dragon!" + bool GossipHello_npc_protectorate_nether_drake(Player *player, Creature *_Creature) { //On Nethery Wings if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778,1) ) - player->ADD_GOSSIP_ITEM(0, "Fly me to Ultris", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); @@ -697,6 +699,49 @@ bool GossipSelect_npc_protectorate_nether_drake(Player *player, Creature *_Creat return true; } +/*###### +## npc_professor_dabiri +######*/ + +#define SPELL_PHASE_DISTRUPTOR 35780 +#define GOSSIP_ITEM "I need a new phase distruptor, Professor" +#define WHISPER_DABIRI "Saeed is currently engaged or awaiting orders to engage. You may check directly east of me and see if Saeed is ready for you. If he is not present then he is off fighting another battle. I recommend that you wait for him to return before attacking Dimensius." + +#define QUEST_DIMENSIUS 10439 +#define QUEST_ON_NETHERY_WINGS 10438 + +bool GossipHello_npc_professor_dabiri(Player *player, Creature *_Creature) +{ + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu( _Creature->GetGUID() ); + + if(player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778, 1)) + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_professor_dabiri(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + _Creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false); + player->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +bool QuestAccept_npc_professor_dabiri(Player *player, Creature *creature, Quest const *quest ) +{ + if(quest->GetQuestId() == QUEST_DIMENSIUS) + creature->Whisper(WHISPER_DABIRI, player->GetGUID(), false); + + return true; +} + /*###### ## npc_veronia ######*/ @@ -870,6 +915,13 @@ void AddSC_netherstorm() newscript->pGossipSelect = &GossipSelect_npc_protectorate_nether_drake; newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_professor_dabiri"; + newscript->pGossipHello = &GossipHello_npc_professor_dabiri; + newscript->pGossipSelect = &GossipSelect_npc_professor_dabiri; + newscript->pQuestAccept = &QuestAccept_npc_professor_dabiri; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name="npc_veronia"; newscript->pGossipHello = &GossipHello_npc_veronia; -- cgit v1.2.3 From c58a199db80fd3d24075582d239f782416c78de1 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 26 Dec 2008 15:46:10 -0600 Subject: *Try to fix the bug about crash caused by waypoint. --HG-- branch : trunk --- src/game/WaypointMovementGenerator.cpp | 12 +++++++++--- src/game/WaypointMovementGenerator.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 85ef44b51be..67c56d763bc 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -36,11 +36,17 @@ void WaypointMovementGenerator::Initialize(Creature &u) { u.StopMoving(); - i_nextMoveTime.Reset(0); - i_currentNode = -1; if(!path_id) path_id = u.GetWaypointPath(); - waypoints = WaypointMgr.GetPath(path_id); + waypoints = WaypointMgr.GetPath(path_id); + if(waypoints && waypoints->size()) + { + Traveller traveller(unit); + node = *(waypoints->at(i_currentNode)); + InitTraveller(u,node); + i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + } } template<> diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 5e01984d42c..99d111063de 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -81,7 +81,7 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator private: WaypointData node; - uint32 i_currentNode, path_id; + uint32 path_id; TimeTrackerSmall i_nextMoveTime; WaypointPath *waypoints; bool repeating, StopedByPlayer; -- cgit v1.2.3 From 032de9a49108b2df6ee01c92c7de2557e4eb6136 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 26 Dec 2008 15:55:12 -0600 Subject: *Update IsAOE function. --HG-- branch : trunk --- src/game/SharedDefines.h | 4 ++-- src/game/SpellEffects.cpp | 2 +- src/game/SpellMgr.cpp | 32 +++++++++++++++++++++++++++++++- src/game/SpellMgr.h | 32 ++++---------------------------- src/game/Unit.cpp | 2 +- 5 files changed, 39 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 51fba0b48ed..07840998cf2 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -821,7 +821,7 @@ enum Targets TARGET_GAMEOBJECT = 23, //TARGET_OBJECT_OPEN TARGET_IN_FRONT_OF_CASTER = 24, - //TARGET_UNIT_CONE_ENEMY + TARGET_UNIT_CONE_ENEMY = 24, TARGET_DUELVSPLAYER = 25, TARGET_UNIT_TARGET_ANY = 25, TARGET_GAMEOBJECT_ITEM = 26, @@ -874,7 +874,7 @@ enum Targets TARGET_UNIT_CONE_ALLY = 59, TARGET_UNIT_AREA_SCRIPT = 60, TARGET_AREAEFFECT_PARTY_AND_CLASS = 61, - //TARGET_UNIT_CLASS_TARGET + TARGET_UNIT_CLASS_TARGET = 61, TARGET_TEST = 62, // for a test spell TARGET_DUELVSPLAYER_COORDINATES = 63, TARGET_DEST_TARGET_ENEMY_UNKNOWN = 63, diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index e8fdbf5adce..85984eeaa3d 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -568,7 +568,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) //TODO: should this be put on taken but not done? if(found) - m_damage += m_spellInfo->EffectBasePoints[1]; + damage += m_spellInfo->EffectBasePoints[1]; } //Explosive Trap Effect else if(m_spellInfo->SpellFamilyFlags & 0x00000004) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 2e285ea7176..6f6cb7e8d65 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -118,7 +118,8 @@ SpellMgr::SpellMgr() case TARGET_UNIT_AREA_ENTRY: case TARGET_UNIT_AREA_PARTY_GROUND: case TARGET_UNIT_AREA_PARTY: - case TARGET_UNIT_AREA_ENEMY_CHANNEL: + //case TARGET_UNIT_AREA_ENEMY_CHANNEL: + //case TARGET_UNIT_AREA_ALLY_CHANNEL: SpellTargetType[i] = TARGET_TYPE_AREA_DEST; break; case TARGET_DEST_TARGET_ENEMY: @@ -156,6 +157,35 @@ SpellMgr::SpellMgr() SpellTargetType[i] = TARGET_TYPE_DEFAULT; } } + + for(int i = 0; i < TOTAL_SPELL_TARGETS; ++i) + { + switch(i) + { + case TARGET_UNIT_AREA_ENEMY_GROUND: + case TARGET_UNIT_AREA_ENEMY: + case TARGET_UNIT_AREA_ALLY_GROUND: + case TARGET_UNIT_AREA_ALLY: + case TARGET_UNIT_AREA_ENTRY_GROUND: + case TARGET_UNIT_AREA_ENTRY: + case TARGET_UNIT_AREA_PARTY_GROUND: + case TARGET_UNIT_AREA_PARTY: + //Check persistant aura seperately + //case TARGET_UNIT_AREA_ENEMY_CHANNEL: + //case TARGET_UNIT_AREA_ALLY_CHANNEL: + case TARGET_UNIT_PARTY_TARGET: + case TARGET_UNIT_PARTY_CASTER: + case TARGET_UNIT_CONE_ENEMY: + case TARGET_UNIT_CONE_ALLY: + case TARGET_UNIT_CONE_ENEMY_UNKNOWN: + case TARGET_UNIT_RAID: + IsAreaEffectTarget[i] = true; + break; + default: + IsAreaEffectTarget[i] = false; + break; + } + } } SpellMgr::~SpellMgr() diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index d8b4b866655..716760a70c6 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -359,38 +359,14 @@ bool IsAuraAddedBySpell(uint32 auraType, uint32 spellId); bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 zone_id,uint32 area_id); -inline bool IsAreaEffectTarget( Targets target ) -{ - switch (target ) - { - case TARGET_AREAEFFECT_CUSTOM: - case TARGET_ALL_ENEMY_IN_AREA: - case TARGET_ALL_ENEMY_IN_AREA_INSTANT: - case TARGET_ALL_PARTY_AROUND_CASTER: - case TARGET_ALL_AROUND_CASTER: - case TARGET_ALL_ENEMY_IN_AREA_CHANNELED: - case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER: - case TARGET_ALL_PARTY: - case TARGET_ALL_PARTY_AROUND_CASTER_2: - case TARGET_AREAEFFECT_PARTY: - case TARGET_AREAEFFECT_CUSTOM_2: - case TARGET_AREAEFFECT_PARTY_AND_CLASS: - case TARGET_IN_FRONT_OF_CASTER: - case TARGET_ALL_FRIENDLY_UNITS_IN_AREA: - return true; - default: - break; - } - return false; -} - +static bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS]; inline bool IsAreaOfEffectSpell(SpellEntry const *spellInfo) { - if(IsAreaEffectTarget(Targets(spellInfo->EffectImplicitTargetA[0])) || IsAreaEffectTarget(Targets(spellInfo->EffectImplicitTargetB[0]))) + if(IsAreaEffectTarget[spellInfo->EffectImplicitTargetA[0]] || IsAreaEffectTarget[spellInfo->EffectImplicitTargetB[0]]) return true; - if(IsAreaEffectTarget(Targets(spellInfo->EffectImplicitTargetA[1])) || IsAreaEffectTarget(Targets(spellInfo->EffectImplicitTargetB[1]))) + if(IsAreaEffectTarget[spellInfo->EffectImplicitTargetA[1]] || IsAreaEffectTarget[spellInfo->EffectImplicitTargetB[1]]) return true; - if(IsAreaEffectTarget(Targets(spellInfo->EffectImplicitTargetA[2])) || IsAreaEffectTarget(Targets(spellInfo->EffectImplicitTargetB[2]))) + if(IsAreaEffectTarget[spellInfo->EffectImplicitTargetA[2]] || IsAreaEffectTarget[spellInfo->EffectImplicitTargetB[2]]) return true; return false; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a079964ce3e..010c5a4d8c4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12243,7 +12243,7 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT break; } - if(IsAreaEffectTarget(Targets(spellProto->EffectImplicitTargetA[i])) || IsAreaEffectTarget(Targets(spellProto->EffectImplicitTargetB[i]))) + if(IsAreaEffectTarget[spellProto->EffectImplicitTargetA[i]] || IsAreaEffectTarget[spellProto->EffectImplicitTargetB[i]]) AreaEffect = true; } -- cgit v1.2.3