aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp107
-rw-r--r--src/game/SpellEffects.cpp4
2 files changed, 107 insertions, 4 deletions
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
index 9870451b836..d0343c9b5a5 100644
--- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
+++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
@@ -618,7 +618,6 @@ struct TRINITY_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI
m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
event_starter = 0;
event_startet = false;
-
m_creature->SetHomePosition(home_x,home_y,home_z,home_ori);
m_creature->GetMotionMaster()->MoveTargetedHome();
}
@@ -1183,6 +1182,107 @@ CreatureAI* GetAI_npc_dkc1_gothik(Creature *_Creature)
// npc 28912 quest 17217 boss 29001 mob 29007 go 191092
+/*####
+## npc_valkyr_battle_maiden
+####*/
+#define SPELL_REVIVE 51918
+#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!"
+
+struct TRINITY_DLL_DECL npc_valkyr_battle_maidenAI : public ScriptedAI
+{
+ npc_valkyr_battle_maidenAI(Creature *c) : ScriptedAI(c) {}
+
+ Player *Owner;
+ uint32 FlyBackTimer;
+ uint64 TargetGUID;
+ float x, y, z;
+ uint32 phase;
+
+ void Reset()
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->SetFlying(true);
+ FlyBackTimer = 500;
+ phase = 0;
+
+ Owner = NULL;
+ m_creature->GetPosition(x, y, z);
+ z += 4; x -= 3.5; y -= 5;
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->Relocate(x, y, z);
+ }
+
+ void Aggro(Unit *who){}
+
+ void AttackStart(Unit *who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!Owner)
+ {
+ TargetGUID = m_creature->GetOwnerGUID();
+ Owner = Unit::GetPlayer(TargetGUID);
+ return;
+ }
+
+ if (Owner->isAlive())
+ phase = 3;
+
+ if (FlyBackTimer < diff)
+ {
+ switch(phase)
+ {
+ case 0:
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
+ FlyBackTimer = 500;
+ phase = 1;
+ break;
+ case 1:
+ Owner->GetClosePoint(x,y,z, m_creature->GetObjectSize());
+ z += 2.5; x -= 2; y -= 1.5;
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Owner->GetGUID());
+ m_creature->SetVisibility(VISIBILITY_ON);
+ FlyBackTimer = 4500;
+ phase = 2;
+ break;
+ case 2:
+ if(!Owner->isRessurectRequested())
+ {
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
+ DoCast(Owner, SPELL_REVIVE,true);
+ DoWhisper(VALK_WHISPER,Owner);
+ }
+ FlyBackTimer = 5000;
+ phase = 3;
+ break;
+ case 3:
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ FlyBackTimer = 2000;
+ phase = 4;
+ break;
+ case 4:
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->RemoveCorpse();
+ break;
+ default:
+ //Nothing To DO
+ break;
+ }
+ }else FlyBackTimer-=diff;
+ }
+
+ void MoveInLineOfSight(Unit *who){}
+
+};
+
+CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature *_Creature)
+{
+ return new npc_valkyr_battle_maidenAI (_Creature);
+}
+
void AddSC_the_scarlet_enclave()
{
Script *newscript;
@@ -1233,4 +1333,9 @@ void AddSC_the_scarlet_enclave()
newscript->Name = "npc_a_special_surprise";
newscript->GetAI = &GetAI_npc_a_special_surprise;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_valkyr_battle_maiden";
+ newscript->GetAI = &GetAI_npc_valkyr_battle_maiden;
+ newscript->RegisterSelf();
}
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index b34fab6afc9..20c60fdb0a3 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3461,11 +3461,9 @@ void Spell::EffectSummonType(uint32 i)
TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
TempSummon * summon = m_originalCaster->SummonCreature(entry,px,py,pz,m_caster->GetOrientation(),summonType,duration);
+ summon->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_originalCaster->GetGUID());
if (properties->Category == SUMMON_CATEGORY_ALLY)
- {
- summon->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_originalCaster->GetGUID());
summon->setFaction(m_originalCaster->getFaction());
- }
}
break;
}