aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/667_world_scripts.sql1
-rw-r--r--src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp54
-rw-r--r--src/game/SharedDefines.h4
-rw-r--r--src/game/SpellEffects.cpp2
-rw-r--r--src/game/SpellMgr.cpp32
-rw-r--r--src/game/SpellMgr.h32
-rw-r--r--src/game/Unit.cpp2
-rw-r--r--src/game/WaypointMovementGenerator.cpp12
-rw-r--r--src/game/WaypointMovementGenerator.h2
9 files changed, 103 insertions, 38 deletions
diff --git a/sql/updates/667_world_scripts.sql b/sql/updates/667_world_scripts.sql
new file mode 100644
index 00000000000..1da0cea44e1
--- /dev/null
+++ b/sql/updates/667_world_scripts.sql
@@ -0,0 +1 @@
+update creature_template set scriptname='npc_professor_dabiri' where entry=20907; \ No newline at end of file
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());
@@ -698,6 +700,49 @@ bool GossipSelect_npc_protectorate_nether_drake(Player *player, Creature *_Creat
}
/*######
+## 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;
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;
}
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<Creature>::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<Creature> 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;