diff options
Diffstat (limited to 'src')
3 files changed, 183 insertions, 69 deletions
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 39b2fbce6b0..80f38dbd7cf 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -35,7 +35,6 @@ enum Misc RAND_VENDOR = 2, WORLDSTATE_SHOW_TIMER = 3104, WORLDSTATE_TIME_TO_SACRIFICE = 3106 - }; // Chests spawn at bear/eagle/dragonhawk/lynx bosses @@ -55,6 +54,8 @@ static SHostageInfo HostageInfo[] = {24024, 186667, 413, 1117, 6.32f, 3.1f} // lynx }; +Position const HarrisonJonesLoc = {120.687f, 1674.0f, 42.0217f, 1.59044f}; + class instance_zulaman : public InstanceMapScript { public: @@ -105,12 +106,15 @@ class instance_zulaman : public InstanceMapScript ZulJinDoorGUID = 0; QuestTimer = 0; - QuestMinute = 21; + QuestMinute = 0; BossKilled = 0; ChestLooted = 0; for (uint8 i = 0; i < RAND_VENDOR; ++i) RandVendor[i] = NOT_STARTED; + + m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED; + instance->SummonCreature(NPC_HARRISON_JONES, HarrisonJonesLoc); } bool IsEncounterInProgress() const @@ -126,9 +130,6 @@ class instance_zulaman : public InstanceMapScript { switch (creature->GetEntry()) { - case NPC_HARRISON_JONES: - if (m_auiEncounter[DATA_GONGEVENT] == DONE) - creature->RemoveFromWorld(); case NPC_JANALAI: case NPC_ZULJIN: case NPC_HEXLORD: @@ -181,6 +182,9 @@ class instance_zulaman : public InstanceMapScript void CheckInstanceStatus() { + if (m_auiEncounter[DATA_GONGEVENT] == DONE) + HandleGameObject(MassiveGateGUID, true); + if (BossKilled >= DATA_HALAZZIEVENT) HandleGameObject(HexLordGateGUID, true); @@ -224,7 +228,10 @@ class instance_zulaman : public InstanceMapScript { case DATA_GONGEVENT: m_auiEncounter[DATA_GONGEVENT] = data; - HandleGameObject(MassiveGateGUID, data == DONE); + if (data == SPECIAL) + SaveToDB(); + if (data == DONE) + QuestMinute = 21; break; case DATA_NALORAKKEVENT: m_auiEncounter[DATA_NALORAKKEVENT] = data; @@ -301,13 +308,13 @@ class instance_zulaman : public InstanceMapScript { switch (type) { - case DATA_GONGEVENT: return m_auiEncounter[0]; - case DATA_NALORAKKEVENT: return m_auiEncounter[1]; - case DATA_AKILZONEVENT: return m_auiEncounter[2]; - case DATA_JANALAIEVENT: return m_auiEncounter[3]; - case DATA_HALAZZIEVENT: return m_auiEncounter[4]; - case DATA_HEXLORDEVENT: return m_auiEncounter[5]; - case DATA_ZULJINEVENT: return m_auiEncounter[6]; + case DATA_GONGEVENT: return m_auiEncounter[DATA_GONGEVENT]; + case DATA_NALORAKKEVENT: return m_auiEncounter[DATA_NALORAKKEVENT]; + case DATA_AKILZONEVENT: return m_auiEncounter[DATA_AKILZONEVENT]; + case DATA_JANALAIEVENT: return m_auiEncounter[DATA_JANALAIEVENT]; + case DATA_HALAZZIEVENT: return m_auiEncounter[DATA_HALAZZIEVENT]; + case DATA_HEXLORDEVENT: return m_auiEncounter[DATA_HEXLORDEVENT]; + case DATA_ZULJINEVENT: return m_auiEncounter[DATA_ZULJINEVENT]; case DATA_CHESTLOOTED: return ChestLooted; case TYPE_RAND_VENDOR_1: return RandVendor[0]; case TYPE_RAND_VENDOR_2: return RandVendor[1]; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index e8b6d7b6349..6962e599279 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -207,14 +207,15 @@ enum Says { SAY_HARRISON_0 = 0, SAY_HARRISON_1 = 1, - SAY_HARRISON_2 = 2, - SAY_HARRISON_3 = 3 + SAY_HARRISON_2 = 0, + SAY_HARRISON_3 = 1 }; enum Spells { SPELL_BANGING_THE_GONG = 45225, - SPELL_STEALTH = 34189 + SPELL_STEALTH = 34189, + SPELL_COSMETIC_SPEAR_THROW = 43647 }; enum Events @@ -228,21 +229,40 @@ enum Events GONG_EVENT_7 = 7, GONG_EVENT_8 = 8, GONG_EVENT_9 = 9, - GONG_EVENT_10 = 10 + GONG_EVENT_10 = 10, + GONG_EVENT_11 = 11, + GONG_EVENT_12 = 12 }; -enum Entrys +enum Waypoints { - NPC_HARRISON_JONES_2 = 24375 + HARRISON_MOVE_1 = 860440, + HARRISON_MOVE_2 = 860441, + HARRISON_MOVE_3 = 860442 }; -enum Waypoints +enum DisplayIds +{ + MODEL_HARRISON_JONES_0 = 22340, + MODEL_HARRISON_JONES_1 = 22354, + MODEL_HARRISON_JONES_2 = 22347 +}; + +enum EntryIds +{ + NPC_HARRISON_JONES_1 = 24375, + NPC_HARRISON_JONES_2 = 24365, + NPC_AMANISHI_GUARDIAN = 23597, +}; + +enum Weapons { - HARRISON_MOVE_1 = 861770, - HARRISON_MOVE_2 = 861771, - HARRISON_MOVE_3 = 861772 + WEAPON_MACE = 5301, + WEAPON_SPEAR = 13631 }; +Position const AmanishiGuardianLoc = {120.687f, 1674.0f, 42.0217f, 1.59044f}; + class npc_harrison_jones : public CreatureScript { public: @@ -263,11 +283,13 @@ class npc_harrison_jones : public CreatureScript uint8 _gongEvent; uint32 _gongTimer; + uint64 uiTargetGUID; void Reset() { _gongEvent = 0; _gongTimer = 0; + uiTargetGUID = 0; } void EnterCombat(Unit* /*who*/) {} @@ -279,12 +301,29 @@ class npc_harrison_jones : public CreatureScript player->CLOSE_GOSSIP_MENU(); me->SetInFront(player); me->SendMovementFlagUpdate(true); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Talk(SAY_HARRISON_0); instance->SetData(DATA_GONGEVENT, IN_PROGRESS); _gongEvent = GONG_EVENT_1; - _gongTimer = 1; + _gongTimer = 4000; } } + void SpellHit(Unit*, const SpellInfo* spell) + { + if (spell->Id == SPELL_COSMETIC_SPEAR_THROW) + { + me->RemoveAllAuras(); + me->SetEntry(NPC_HARRISON_JONES_2); + me->SetDisplayId(MODEL_HARRISON_JONES_2); + me->SetTarget(0); + me->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_DEAD); + me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + if (instance) + instance->SetData(DATA_GONGEVENT, DONE); + } + } + void UpdateAI(uint32 const diff) { if (_gongEvent) @@ -294,80 +333,120 @@ class npc_harrison_jones : public CreatureScript switch (_gongEvent) { case GONG_EVENT_1: - Talk(SAY_HARRISON_0); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - _gongTimer = 4000; - _gongEvent = GONG_EVENT_2; - break; - case GONG_EVENT_2: me->GetMotionMaster()->MovePath(HARRISON_MOVE_1,false); _gongTimer = 12000; - _gongEvent = GONG_EVENT_3; + _gongEvent = GONG_EVENT_2; break; - case GONG_EVENT_3: + case GONG_EVENT_2: me->SetFacingTo(6.235659f); Talk(SAY_HARRISON_1); DoCast(me, SPELL_BANGING_THE_GONG); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_MACE)); me->SetSheath(SHEATH_STATE_MELEE); _gongTimer = 4000; - _gongEvent = GONG_EVENT_4; + _gongEvent = GONG_EVENT_3; break; - case GONG_EVENT_4: + case GONG_EVENT_3: if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) gong->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); - _gongTimer = 120000; - _gongEvent = GONG_EVENT_5; + _gongTimer = 105000; + _gongEvent = GONG_EVENT_4; break; - case GONG_EVENT_5: + case GONG_EVENT_4: + me->RemoveAura(SPELL_BANGING_THE_GONG); if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) gong->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); + + // trigger or gong will need to be scripted to set SPECIAL if enough players click gong. + // This is temp workaround. if (instance) - instance->SetData(DATA_GONGEVENT, DONE); // This is temp + instance->SetData(DATA_GONGEVENT, SPECIAL); // to be removed. - if (instance->GetData(DATA_GONGEVENT) == DONE) + if (instance->GetData(DATA_GONGEVENT) == SPECIAL) { - // Save all players to instance + // Players are Now Saved to instance at SPECIAL (Player should be notified?) me->GetMotionMaster()->MovePath(HARRISON_MOVE_2,false); _gongTimer = 5000; - _gongEvent = 6; + _gongEvent = 5; } else { - _gongTimer = 0; // Add reset at end - _gongEvent = 0; // Add reset at end + _gongTimer = 1000; + _gongEvent = 10; } break; + case GONG_EVENT_5: + me->SetEntry(NPC_HARRISON_JONES_1); + me->SetDisplayId(MODEL_HARRISON_JONES_1); + Talk(SAY_HARRISON_2); + _gongTimer = 14000; + _gongEvent = 6; + break; case GONG_EVENT_6: - me->SetEntry(NPC_HARRISON_JONES_2); - Talk(SAY_HARRISON_2); - _gongTimer = 14000; - _gongEvent = 7; + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); + Talk(SAY_HARRISON_3); + _gongTimer = 7000; + _gongEvent = 7; break; case GONG_EVENT_7: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); - Talk(SAY_HARRISON_2); - _gongTimer = 7000; - _gongEvent = 8; - break; + if (!uiTargetGUID) + { + std::list<Creature*> targetList; + GetCreatureListWithEntryInGrid(targetList, me, NPC_AMANISHI_GUARDIAN, 26.0f); + if (!targetList.empty()) + { + for (std::list<Creature*>::const_iterator itr = targetList.begin(); itr != targetList.end(); ++itr) + { + if (Creature* ptarget = *itr) + { + if (ptarget->GetPositionX() > 120) + { + ptarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR)); + //ptarget-> setdata for sai (I don't know how to do yet and answers are hard to get) + } + } + } + } + } + + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_MASSIVE_GATE))) + gate->SetGoState(GO_STATE_ACTIVE); + _gongTimer = 1000; + _gongEvent = 8; case GONG_EVENT_8: - // entry 23597 guid 86194 UNIT_VIRTUAL_ITEM_SLOT_ID: 13631 - if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_MASSIVE_GATE))) - gate->SetGoState(GO_STATE_ACTIVE); - _gongTimer = 1000; - _gongEvent = 9; + DoCast(me, SPELL_STEALTH); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); + me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + _gongTimer = 100; + _gongEvent = 9; case GONG_EVENT_9: - DoCast(me, SPELL_STEALTH); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); - me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - _gongTimer = 1000; - _gongEvent = 10; + // If player in 10.0f range + // Send setdata to SAI for previous target + // SAI BELOW + // move 23597, guid 86194 to be deleted + // path 138.2242 Y: 1586.994 Z: 43.5488 + // path 131.8407 Y: 1590.247 Z: 43.61384 + // Reach end of path turnto 2.024582 cast Spell ID: 43647 on self hits 24365 update UNIT_VIRTUAL_ITEM_SLOT_ID: 33979 + // wait 2 sec say text 0 + // Set below after complete above + _gongTimer = 0; + _gongEvent = 0; + break; case GONG_EVENT_10: - // move 23597 guid 86194 - // path 138.2242 Y: 1586.994 Z: 43.5488 - // path 131.8407 Y: 1590.247 Z: 43.61384 - // Reach end of path turnto 2.024582 cast Spell ID: 43647 on self hits 24358 UNIT_VIRTUAL_ITEM_SLOT_ID: 33979 - // wait 2 sec say text 0 + me->GetMotionMaster()->MovePoint(0, 120.687f, 1674.0f, 42.0217f); + _gongTimer = 12000; + _gongEvent = 11; + break; + case GONG_EVENT_11: + me->SetFacingTo(1.59044f); + _gongTimer = 6000; + _gongEvent = 12; + break; + case GONG_EVENT_12: + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + if (instance) + instance->SetData(DATA_GONGEVENT, NOT_STARTED); _gongTimer = 0; _gongEvent = 0; break; @@ -385,10 +464,39 @@ class npc_harrison_jones : public CreatureScript } }; +class spell_banging_the_gong : public SpellScriptLoader +{ + public: + spell_banging_the_gong() : SpellScriptLoader("spell_banging_the_gong") { } + + class spell_banging_the_gong_SpellScript : public SpellScript + { + PrepareSpellScript(spell_banging_the_gong_SpellScript); + + void Activate(SpellEffIndex index) + { + PreventHitDefaultEffect(index); + + GetHitGObj()->SendCustomAnim(0); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_banging_the_gong_SpellScript::Activate, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_banging_the_gong_SpellScript(); + } +}; + void AddSC_zulaman() { new npc_forest_frog(); new npc_zulaman_hostage(); new npc_harrison_jones(); + new spell_banging_the_gong(); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index 5b5e6faef83..c3386f8c996 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -51,7 +51,6 @@ enum GameobjectIds GO_MASSIVE_GATE = 186728, GO_DOOR_AKILZON = 186858, GO_DOOR_ZULJIN = 186859, - GO_HARKORS_SATCHEL = 187021, GO_TANZARS_TRUNK = 186648, GO_ASHLIS_BAG = 186672, |