From 704be96b4c25fa4566da22940f436eadc43679a1 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 1 Jan 2009 19:32:44 -0600 Subject: *Add console command "difftime" to change the interval to record diff time in log. --HG-- branch : trunk --- src/game/Chat.cpp | 1 + src/game/Chat.h | 1 + src/game/World.h | 1 + src/trinitycore/CliRunnable.cpp | 20 ++++++++++++++++++++ 4 files changed, 23 insertions(+) (limited to 'src') diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 6842fc5b061..3ec5d92bd6a 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -60,6 +60,7 @@ ChatCommand * ChatHandler::getCommandTable() static ChatCommand serverSetCommandTable[] = { { "loglevel", SEC_CONSOLE, true, &ChatHandler::HandleServerSetLogLevelCommand, "", NULL }, + { "difftime", SEC_CONSOLE, true, &ChatHandler::HandleServerSetDiffTimeCommand, "", NULL }, { "motd", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerSetMotdCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; diff --git a/src/game/Chat.h b/src/game/Chat.h index 82d401519cc..9b6e2d54604 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -286,6 +286,7 @@ class ChatHandler bool HandleServerRestartCommand(const char* args); bool HandleServerSetMotdCommand(const char* args); bool HandleServerSetLogLevelCommand(const char* args); + bool HandleServerSetDiffTimeCommand(const char* args); bool HandleServerShutDownCommand(const char* args); bool HandleServerShutDownCancelCommand(const char* args); diff --git a/src/game/World.h b/src/game/World.h index 0bbe835a960..c31e05d5a3b 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -415,6 +415,7 @@ class World uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); } /// Update time uint32 GetUpdateTime() const { return m_updateTime; } + void SetRecordDiffInterval(int32 t) { if(t >= 0) m_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; } /// Get the maximum skill level a player can reach uint16 GetConfigMaxSkillValue() const diff --git a/src/trinitycore/CliRunnable.cpp b/src/trinitycore/CliRunnable.cpp index 7fe2ab784a6..78c6e0dbb85 100644 --- a/src/trinitycore/CliRunnable.cpp +++ b/src/trinitycore/CliRunnable.cpp @@ -272,6 +272,26 @@ bool ChatHandler::HandleServerSetLogLevelCommand(const char *args) return true; } +/// set diff time record interval +bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args) +{ + if(!*args) + return false; + + char *NewTimeStr = strtok((char*)args, " "); + if(!NewTimeStr) + return false; + + int32 NewTime =atoi(NewTimeStr); + if(NewTime < 0) + return false; + + sWorld.SetRecordDiffInterval(NewTime); + printf( "Record diff every %u ms\n", NewTime); + return true; +} + + /// @} #ifdef linux -- cgit v1.2.3 From f82e2395bd02a1d87cb8677d80f7d3f6742ca250 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 1 Jan 2009 21:19:47 -0600 Subject: *Do not let Leader of the Pack have healing bonus. --HG-- branch : trunk --- src/game/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 3f8eb4ac447..b65f3860e90 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9081,7 +9081,8 @@ uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, if (spellProto->Id == 15290 || spellProto->Id == 39373 || spellProto->Id == 33778 || spellProto->Id == 379 || spellProto->Id == 38395 || spellProto->Id == 40972 || - spellProto->Id == 22845 || spellProto->Id == 33504) + spellProto->Id == 22845 || spellProto->Id == 33504 || + spellProto->Id == 34299) return healamount; int32 AdvertisedBenefit = SpellBaseHealingBonus(GetSpellSchoolMask(spellProto)); -- cgit v1.2.3 From 4b8d590774563c08667c5933d6ce2255c0c08108 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 1 Jan 2009 21:22:11 -0600 Subject: *Fix the bug that stun make eating/drinking cannot be interrupted. --HG-- branch : trunk --- src/game/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b65f3860e90..ee4ca89eaa5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9708,7 +9708,7 @@ void Unit::SetInCombatWith(Unit* enemy) void Unit::CombatStart(Unit* target) { - if(!target->IsStandState() && !target->hasUnitState(UNIT_STAT_STUNNED)) + if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/) target->SetStandState(PLAYER_STATE_NONE); //Call creature group update -- cgit v1.2.3 From f415654302d9c0ef2909d9de1aa928fa72b399f4 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 1 Jan 2009 21:43:30 -0600 Subject: *Fix the bug that sap cannot let sitting player stand. --HG-- branch : trunk --- src/game/Spell.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 73a0c114704..96ce55d5540 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1091,6 +1091,11 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) { m_caster->CombatStart(unit); } + else if(spellmgr.GetSpellCustomAttr(m_spellInfo->Id) & SPELL_ATTR_CU_AURA_CC) + { + if(!unit->IsStandState()) + unit->SetStandState(PLAYER_STATE_NONE); + } } } -- cgit v1.2.3 From 363bc3f0f0a7982d200e9d81c6d45ccddf011ced Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 1 Jan 2009 22:28:53 -0600 Subject: *Temp fix for instancemap::add crash. By Visagalis. --HG-- branch : trunk --- src/game/Map.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 0bf1d5b7bf2..6e01788ac58 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -1778,7 +1778,9 @@ bool InstanceMap::Add(Player *player) { sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset()); if(groupBind) sLog.outError("InstanceMap::Add: the group is bound to instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset()); - player->UnbindInstance(GetId(), GetSpawnMode()); + sLog.outError("InstanceMap::Add: do not let player %s enter instance otherwise crash will happen", player->GetName()); + return false; + //player->UnbindInstance(GetId(), GetSpawnMode()); //assert(false); } // bind to the group or keep using the group save -- cgit v1.2.3 From 7422c2b9f6fa35f500ee1b249c64897829fd9e47 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 1 Jan 2009 23:42:11 -0600 Subject: *Some modifications of FindCreature and FindGameobject functions. --HG-- branch : trunk --- src/bindings/scripts/include/sc_creature.cpp | 57 +++++----------------- src/bindings/scripts/include/sc_creature.h | 4 +- .../scripts/scripts/zone/ghostlands/ghostlands.cpp | 4 +- 3 files changed, 17 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index fad8c631e5e..d46d5b68716 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -740,55 +740,24 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); } -Unit* ScriptedAI::FindCreature(uint32 entry, uint32 range, uint32 district) +Unit* ScriptedAI::FindCreature(uint32 entry, float range) { - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = district; - cell.SetNoCreate(); - - std::list NPCList; - + Creature* target = NULL; Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, range); - Trinity::CreatureListSearcher searcher(NPCList, check); - TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap())); - - if (!NPCList.empty()) - { - for(std::list::iterator itr = NPCList.begin(); itr != NPCList.end(); ++itr) - { - return Creature::GetUnit((*m_creature), (*itr)->GetGUID()); - } - }else error_log("SD2 ERROR: Entry: %u not found!", entry); return NULL; + Trinity::CreatureSearcher searcher(target, check); + m_creature->VisitNearbyGridObject(range, searcher); + if(!target) error_log("SD2 ERROR: Entry: %u not found!", entry); + return target; } -GameObject* ScriptedAI::FindGameObject(uint32 entry, uint32 district) +GameObject* ScriptedAI::FindGameObject(uint32 entry, float range) { - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = district; - cell.SetNoCreate(); - - std::list GOList; - - Trinity::AllGameObjectsWithEntryInGrid go_check(entry); - Trinity::GameObjectListSearcher go_search(GOList, go_check); - TypeContainerVisitor - , GridTypeMapContainer> go_visit(go_search); - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap())); - - if (!GOList.empty()) - { - for(std::list::iterator itr = GOList.begin(); itr != GOList.end(); ++itr) - { - return (*itr); - } - } - else error_log("SD2 ERROR: GameObject Entry: %u not found!", entry); return NULL; + GameObject* target = NULL; + Trinity::AllGameObjectsWithEntryInGrid go_check(entry); + Trinity::GameObjectSearcher searcher(target, go_check); + m_creature->VisitNearbyGridObject(range, searcher); + if(!target) error_log("SD2 ERROR: Entry: %u not found!", entry); + return target; } Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 3ece26bdb6f..9c7ffc022eb 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -149,10 +149,10 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void DoTeleportAll(float x, float y, float z, float o); //Get a single creature of given entry - Unit* FindCreature(uint32 entry, uint32 range, uint32 district = ALL_DISTRICT); + Unit* FindCreature(uint32 entry, float range); //Get a single gameobject of given entry - GameObject* FindGameObject(uint32 entry, uint32 district = ALL_DISTRICT); + GameObject* FindGameObject(uint32 entry, float range); //Returns friendly unit with the most amount of hp missing from max hp Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff = 1); diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp index b38e21687da..6350040cfe4 100644 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp @@ -161,7 +161,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI case 0: { m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = FindGameObject(GO_CAGE); + GameObject* Cage = FindGameObject(GO_CAGE, 99); if(Cage) Cage->SetGoState(0); DoScriptText(SAY_START, m_creature, player); @@ -212,7 +212,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI if (!IsBeingEscorted) m_creature->setFaction(1602); - GameObject* Cage = FindGameObject(GO_CAGE); + GameObject* Cage = FindGameObject(GO_CAGE, 99); if(Cage) Cage->SetGoState(1); } -- cgit v1.2.3 From 0b9f25bd7b5fccc497668a2d54a48639f20bb98c Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Fri, 2 Jan 2009 11:42:55 +0100 Subject: *Fix a typo in arathi_highlands.cpp and 748_world_scripts.sql --HG-- branch : trunk --- sql/updates/748_world_scripts.sql | 2 +- .../scripts/zone/arathi_highlands/arathi_highlands.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/sql/updates/748_world_scripts.sql b/sql/updates/748_world_scripts.sql index 484c71f3199..8e59c9bb812 100644 --- a/sql/updates/748_world_scripts.sql +++ b/sql/updates/748_world_scripts.sql @@ -1,3 +1,3 @@ update creature_template set scriptname='npc_infused_crystal', flags_extra=0 where entry=16364; -update quest_template set specialflags=2, reqcreatureorgoid1=1, reqcreatureorgocount1=1 where entry=8490; +update quest_template set specialflags=2, reqcreatureorgoid1=0, reqcreatureorgocount1=0 where entry=8490; delete from creature where id=17086; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp index 92dcb34a433..ad43b63b5f3 100644 --- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp @@ -34,7 +34,7 @@ EndContentData */ #define SAY_PROGRESS_1 "Ok, $N. Follow me to the cave where I'll attempt to harness the power of the rune stone into these goggles." #define SAY_PROGRESS_2 "I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage." -#define SAY_PROGRESS_3 "I'll begin drawing energy from the stone. Your job, $N, i to defend me. This place is cursed... trust me." +#define SAY_PROGRESS_3 "I'll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me." #define EMOTE_PROGRESS_4 "begins tinkering with the goggles before the stone." #define SAY_AGGRO "Help!!! Get these things off me so I can get my work done!" #define SAY_PROGRESS_5 "Almost done! Just a little longer!" @@ -61,10 +61,8 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI case 8:DoTextEmote(EMOTE_PROGRESS_4, NULL);break; case 9: { - Creature* sum1 = m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* sum2 = m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - sum1->Attack(m_creature, true); - sum2->Attack(m_creature, true); + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); break; } case 10:DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, player, true);break; @@ -73,11 +71,17 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI case 20: DoTextEmote(EMOTE_PROGRESS_8, NULL); DoSay(SAY_PROGRESS_9, LANG_UNIVERSAL, player, true); + if(player) ((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); break; } } + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + } + void Reset(){} void Aggro(Unit* who) -- cgit v1.2.3 From 72449b06a7739e8f27e534eaa2325b15c1169e63 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Fri, 2 Jan 2009 12:26:35 +0100 Subject: *Not consider loot multiplier for grouped loot - by Brats --HG-- branch : trunk --- src/game/LootMgr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 4a34f51d672..9271c14ed13 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -777,8 +777,7 @@ LootStoreItem const * LootTemplate::LootGroup::Roll() const return &ExplicitlyChanced[i]; ItemPrototype const *pProto = objmgr.GetItemPrototype(ExplicitlyChanced[i].itemid); - float qualityMultiplier = pProto ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f; - Roll -= ExplicitlyChanced[i].chance * qualityMultiplier; + Roll -= ExplicitlyChanced[i].chance; if (Roll < 0) return &ExplicitlyChanced[i]; } -- cgit v1.2.3 From 44b1df25adf585a3c894301121a5638c70197e2f Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Fri, 2 Jan 2009 13:28:06 +0100 Subject: *Fixed area explode effect of 31447 --HG-- branch : trunk --- src/game/SpellAuras.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6865c67d24c..06fff3309c0 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5777,6 +5777,13 @@ void Aura::PeriodicTick() int32 gain = pCaster->ModifyPower(power,gain_amount); m_target->AddThreat(pCaster, float(gain) * 0.5f, GetSpellSchoolMask(GetSpellProto()), GetSpellProto()); } + // Mark of Kaz'rogal + if(GetId() == 31447 && m_target->GetPower(power) == 0) + { + m_target->CastSpell(m_target, 31463, true, 0, this); + // Remove aura + SetAuraDuration(0); + } break; } case SPELL_AURA_PERIODIC_ENERGIZE: -- cgit v1.2.3 From 461d457139d3f22ca0b16dbc0675236552b9c4f8 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Fri, 2 Jan 2009 15:20:51 +0100 Subject: *Added Nightbane script - by BroodWyrm --HG-- branch : trunk --- sql/updates/758_world_scripts.sql | 5 + src/bindings/scripts/ScriptMgr.cpp | 2 + .../scripts/zone/karazhan/boss_nightbane.cpp | 379 ++++++++++++++++++++- .../scripts/zone/karazhan/instance_karazhan.cpp | 7 +- 4 files changed, 388 insertions(+), 5 deletions(-) create mode 100644 sql/updates/758_world_scripts.sql (limited to 'src') diff --git a/sql/updates/758_world_scripts.sql b/sql/updates/758_world_scripts.sql new file mode 100644 index 00000000000..a988a426df7 --- /dev/null +++ b/sql/updates/758_world_scripts.sql @@ -0,0 +1,5 @@ +delete from creature_template_addon where entry = 17225; +update creature_template set scriptname = 'boss_nightbane', unit_flags=0 where entry = 17225; +delete from event_scripts where id = 10951; +insert into event_scripts values +(10951,0,10,17651,180000,0,-11159,-1907.22,91.48,0); \ No newline at end of file diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 8fb5bdb1021..651bc6a95f6 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -342,6 +342,7 @@ extern void AddSC_boss_moroes(); extern void AddSC_bosses_opera(); extern void AddSC_instance_karazhan(); extern void AddSC_karazhan(); +extern void AddSC_boss_nightbane(); //Loch Modan extern void AddSC_loch_modan(); @@ -1547,6 +1548,7 @@ void ScriptsInit() AddSC_bosses_opera(); AddSC_instance_karazhan(); AddSC_karazhan(); + AddSC_boss_nightbane(); //Loch Modan AddSC_loch_modan(); diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp index bffb418980a..17fec0d2e75 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp @@ -16,18 +16,389 @@ /* ScriptData SDName: Boss_Nightbane -SD%Complete: 0 -SDComment: Place holder +SD%Complete: 50 +SDComment: skelleton adds, optimice some "if"s, timers, rain of bones applied self(!?) SDCategory: Karazhan EndScriptData */ #include "precompiled.h" - +#include "def_karazhan.h" + +//phase 1 #define SPELL_BELLOWING_ROAR 39427 -#define SPELL_CHARRED_EARTH 30129 //Also 30209 (Target Charred Earth) triggers this +#define SPELL_CHARRED_EARTH 30129 //Also 30209 (Target Charred Earth) triggers this #define SPELL_DISTRACTING_ASH 30130 #define SPELL_SMOLDERING_BREATH 30210 #define SPELL_TAIL_SWEEP 25653 +//phase 2 #define SPELL_RAIN_OF_BONES 37098 #define SPELL_SMOKING_BLAST 37057 #define SPELL_FIREBALL_BARRAGE 30282 +#define SPELL_SEARING_CINDERS 30127 + +float IntroWay[8][3] = +{ + {-11053.37,-1794.48,149}, + {-11141.07,-1841.40,125}, + {-11187.28,-1890.23,125}, + {-11189.20,-1931.25,125}, + {-11153.76,-1948.93,125}, + {-11128.73,-1929.75,125}, + {-11140 , -1915 ,122}, + {-11163 , -1903 ,91.473} +}; + +//float IntroWay[5][3] = +//{ +// {-11000.00, -1765.75, 140.40}, +// {-11000.00, -1765.75, 171.00}, +// {-11173.67, -1832.26, 117.76}, +// {-11142.75, -1916.78, 119.769}, +// {-11161.91, -1911.148, 91.473} +//}; + +struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI +{ + boss_nightbaneAI(Creature* c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + intro = true; + Reset(); + } + + ScriptedInstance* pInstance; + + uint32 phase; + + bool rainbones; + + uint32 bellowingroar_timer; + uint32 charredearth_timer; + uint32 distractingash_timer; + uint32 smolderingbreath_timer; + uint32 tailsweep_timer; + uint32 rainofbones_timer; + uint32 smokingblast_timer; + uint32 fireballbarrage_timer; + uint32 searingcinders_timer; + + uint32 fly_count; + uint32 fly_timer; + + bool intro; + bool flying; + uint32 wait_timer; + uint32 MovePhase; + + void Reset() + { + phase =1; + bellowingroar_timer = 30000; + charredearth_timer = 15000; + distractingash_timer = 20000; + smolderingbreath_timer = 10000; + tailsweep_timer = 12000; + rainofbones_timer = 10000; + smokingblast_timer = 20000; + fireballbarrage_timer = 13000; + searingcinders_timer = 14000; + + fly_count = 0; + + m_creature->SetSpeed(MOVE_RUN,2); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->setActive(true); + wait_timer = 1000; + MovePhase = 0; + + if(pInstance) + pInstance->SetData(DATA_NIGHTBANE_EVENT, NOT_STARTED); + + flying = false; + + if(!intro) + { + m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + } + + void Aggro(Unit *who) + { + if(pInstance) + pInstance->SetData(DATA_NIGHTBANE_EVENT, IN_PROGRESS); + } + void AttackStart(Unit* who) + { + if(!intro && !flying) + ScriptedAI::AttackStart(who); + } + + void JustDied(Unit* killer) + { + if(pInstance) + pInstance->SetData(DATA_NIGHTBANE_EVENT, DONE); + } + void MoveInLineOfSight(Unit *who) + { + if(!intro && !flying) + { + if(!m_creature->getVictim() && m_creature->canStartAttack(who)) + ScriptedAI::AttackStart(who); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if(type != POINT_MOTION_TYPE) + return; + + if(intro) + { + if(id >= 8) + { + intro = false; + m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); + return; + } + + wait_timer = 1; + } + + if(flying) + { + if(id == 0) + { + flying = false; + phase = 2; + return; + } + if(id == 3) + { + MovePhase = 4; + wait_timer = 1; + return; + } + if(id == 8) + { + flying = false; + phase = 1; + return; + } + + wait_timer = 1; + } + } + + void UpdateAI(const uint32 diff) + { + if(wait_timer) + if(wait_timer < diff) + { + if(intro) + { + if(MovePhase >= 7) + { + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); + } + else + { + m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); + MovePhase++; + } + } + + + if(flying) + { + if(MovePhase >= 7) + { + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); + } + else + { + m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); + MovePhase++; + } + } + + wait_timer = 0; + }else wait_timer -= diff; + + if(!m_creature->SelectHostilTarget()) + return; + + if(flying) + return; + + // Phase 1 "GROUND FIGHT" + if(phase == 1) + { + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + if (bellowingroar_timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR); + bellowingroar_timer = 30000+rand()%10000 ; //Timer + }else bellowingroar_timer -= diff; + + if (smolderingbreath_timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH); + smolderingbreath_timer = 20000;//timer + + }else smolderingbreath_timer -= diff; + + if (charredearth_timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + DoCast(target,SPELL_CHARRED_EARTH); + charredearth_timer = 20000; //timer + }else charredearth_timer -= diff; + + if (tailsweep_timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (!m_creature->HasInArc( M_PI, target)) + DoCast(target,SPELL_TAIL_SWEEP); + tailsweep_timer = 15000;//timer + }else tailsweep_timer -= diff; + + if (searingcinders_timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + DoCast(target,SPELL_SEARING_CINDERS); + searingcinders_timer = 10000; //timer + }else searingcinders_timer -= diff; + + uint32 prozent; + prozent = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth(); + + if (prozent < 75 && fly_count == 0) // first take off 75% + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + (*m_creature).GetMotionMaster()->Clear(false); + (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); + flying = true; + + fly_timer = 45000+rand()%15000; + fly_count++; + + rainofbones_timer = 5000; + rainbones = false; + } + + if (prozent < 50 && fly_count == 1) // secound take off 50% + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + (*m_creature).GetMotionMaster()->Clear(false); + (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); + + flying = true; + fly_timer = 45000+rand()%15000; + fly_count++; + + rainofbones_timer = 5000; + rainbones = false; + } + + if (prozent < 25 && fly_count == 2) // third take off 25% + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + (*m_creature).GetMotionMaster()->Clear(false); + (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); + + flying = true; + //phase = 2; + fly_timer = 45000+rand()%15000; + fly_count++; + + rainofbones_timer = 5000; + rainbones = false; + } + + DoMeleeAttackIfReady(); + } + + //Phase 2 "FLYING FIGHT" + if (phase == 2) + { + if (!rainbones) + { + if (rainofbones_timer < diff && !rainbones) // only once at the beginning of phase 2 + { + DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES); + rainbones = true; + smokingblast_timer = 20000; + }else rainofbones_timer -= diff; + + if (distractingash_timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + DoCast(target,SPELL_DISTRACTING_ASH); + distractingash_timer = 2000;//timer wrong + }else distractingash_timer -= diff; + } + + if (rainbones) + { + if (smokingblast_timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SMOKING_BLAST); + smokingblast_timer = 1500 ; //timer wrong + }else smokingblast_timer -= diff; + } + + if (fireballbarrage_timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_FARTHEST,0); + + DoCast(target,SPELL_FIREBALL_BARRAGE); + fireballbarrage_timer = 20000; //Timer + }else fireballbarrage_timer -= diff; + + if (fly_timer < diff) //landing + { + //m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + //m_creature->SetHover(false); + (*m_creature).GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]); + flying = true; + //wait_timer = 1; + //phase = 1; + }else fly_timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_nightbane(Creature *_Creature) +{ + return new boss_nightbaneAI (_Creature); +} + +void AddSC_boss_nightbane() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_nightbane"; + newscript->GetAI = GetAI_boss_nightbane; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp index 5af12a4fb0b..9fea30e1c93 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp @@ -59,7 +59,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance uint64 MassiveDoor; // Door at Netherspite uint64 GamesmansDoor; // Door before Chess uint64 GamesmansExitDoor; // Door after Chess - uint64 NetherspaceDoor; // Door at Malchezaar + uint64 NetherspaceDoor; // Door at Malchezaar + uint64 MastersTerraceDoor[2]; uint64 ImageGUID; @@ -84,6 +85,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance GamesmansDoor = 0; GamesmansExitDoor = 0; NetherspaceDoor = 0; + MastersTerraceDoor[0]= 0; + MastersTerraceDoor[1]= 0; ImageGUID = 0; } @@ -199,6 +202,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance case 184276: GamesmansDoor = go->GetGUID(); break; case 184277: GamesmansExitDoor = go->GetGUID(); break; case 185134: NetherspaceDoor = go->GetGUID(); break; + case 184274: MastersTerraceDoor[0] = go->GetGUID(); break; + case 184280: MastersTerraceDoor[1] = go->GetGUID(); break; } switch(OperaEvent) -- cgit v1.2.3 From deac8370d71c0f72b5d60709c09dc2830c1680bd Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Fri, 2 Jan 2009 16:24:57 +0100 Subject: *Fixed parasitic shadowfiend target selection in illidan script - by Lucy --HG-- branch : trunk --- src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp index 73c3f6121db..1c96376d583 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp @@ -1876,7 +1876,7 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon) Unit *target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0, 999, true); if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0) || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0)) - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true); + target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0, 999, true); if(target) summon->AI()->AttackStart(target); }break; -- cgit v1.2.3