fix(DB/SAI): Yenniku (#16631)

* Fix(SAI/C++/NPC): NPC Yenniku and Removal of AI C++

* Update rev_1687759233155225800.sql

Changes made

* Update rev_1687759233155225800.sql

* Update rev_1687759233155225800.sql

* Update rev_1687759233155225800.sql

* Update rev_1687759233155225800.sql

* Update rev_1687759233155225800.sql

* Update rev_1687759233155225800.sql

* Update data/sql/updates/pending_db_world/rev_1687759233155225800.sql

Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com>

* Update rev_1687759233155225800.sql

* Update rev_1687759233155225800.sql

---------

Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com>
This commit is contained in:
The GhostRider
2023-06-29 23:22:11 +01:00
committed by GitHub
parent f8cb2ada20
commit f09be5f124
3 changed files with 22 additions and 131 deletions

View File

@@ -157,7 +157,6 @@ void AddSC_isle_of_queldanas();
void AddSC_redridge_mountains();
void AddSC_silverpine_forest();
void AddSC_stormwind_city();
void AddSC_stranglethorn_vale();
void AddSC_tirisfal_glades();
void AddSC_undercity();
void AddSC_western_plaguelands();
@@ -310,7 +309,6 @@ void AddEasternKingdomsScripts()
AddSC_redridge_mountains();
AddSC_silverpine_forest();
AddSC_stormwind_city();
AddSC_stranglethorn_vale();
AddSC_tirisfal_glades();
AddSC_undercity();
AddSC_western_plaguelands();

View File

@@ -1,129 +0,0 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Stranglethorn_Vale
SD%Complete: 100
SDComment: Quest support: 592
SDCategory: Stranglethorn Vale
EndScriptData */
/* ContentData
npc_yenniku
EndContentData */
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
/*######
## npc_yenniku
######*/
class npc_yenniku : public CreatureScript
{
public:
npc_yenniku() : CreatureScript("npc_yenniku") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_yennikuAI(creature);
}
struct npc_yennikuAI : public ScriptedAI
{
npc_yennikuAI(Creature* creature) : ScriptedAI(creature)
{
bReset = false;
}
uint32 Reset_Timer;
bool bReset;
void Reset() override
{
Reset_Timer = 0;
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
}
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (bReset || spell->Id != 3607)
return;
if (Player* player = caster->ToPlayer())
{
if (player->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE) //Yenniku's Release
{
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
me->CombatStop(); //stop combat
me->GetThreatMgr().ClearAllThreat(); //unsure of this
me->SetFaction(FACTION_HORDE_GENERIC);
bReset = true;
Reset_Timer = 60000;
}
}
}
void JustEngagedWith(Unit* /*who*/) override { }
void UpdateAI(uint32 diff) override
{
if (bReset)
{
if (Reset_Timer <= diff)
{
EnterEvadeMode();
bReset = false;
me->SetFaction(FACTION_TROLL_BLOODSCALP);
return;
}
Reset_Timer -= diff;
if (me->IsInCombat() && me->GetVictim())
{
if (Player* player = me->GetVictim()->ToPlayer())
{
if (player->GetTeamId() == TEAM_HORDE)
{
me->CombatStop();
me->GetThreatMgr().ClearAllThreat();
}
}
}
}
//Return since we have no target
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
};
/*######
##
######*/
void AddSC_stranglethorn_vale()
{
new npc_yenniku();
}