Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts scripted tarindrella #161

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql/updates/master/world/2023_11_16_world_tarindella.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE `creature_template` SET `ScriptName`='npc_tarindrella' WHERE `entry`=49480;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Her two quests show in video after 4.0.3 is different from this script.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing to add code script cpp for this

2 changes: 1 addition & 1 deletion src/server/scripts/Kalimdor/zone_tanaris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class npc_steward_of_time : public CreatureScript
public:
npc_steward_of_time() : CreatureScript("npc_steward_of_time") { }

bool OnQuestAccept(Player* player, Creature* /*creature*/, Quest const* quest)
bool OnQuestAccept(Player* player, Creature* /*creature*/, Quest const* quest) OVERRIDE
{
if (quest->GetQuestId() == 10279) //Quest: To The Master's Lair
player->CastSpell(player, 34891, true); //(Flight through Caverns)
Expand Down
119 changes: 119 additions & 0 deletions src/server/scripts/Kalimdor/zone_teldrassil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,124 @@ EndContentData */
#include "ScriptedFollowerAI.h"
#include "Player.h"

/*####
# npc_tarindrella
####*/

enum VileTouch
{
QUEST_VILE_TOUCH = 28727,

EVENT_CLEANSE_SPIRIT = 1,
EVENT_ENTANGLING_ROOTS = 2,
EVENT_SUMMON_NATURES_BITE = 3,

SPELL_ENTANGLING_ROOTS = 33844,
SPELL_SUMMON_NATURES_BITE = 92573,
SPELL_CLEANSE_SPIRIT = 66056

};
#define TARINDRELLA_TEXT_ON_COMPLETE "This totem has been corrupting the eggs! It seems a greater threat looms. The Gnarlpine remain tainted by something most foul."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to Creature Text

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#define TARINDRELLA_CREATURE_TEXT_ON_COMPLETE "This totem has been corrupting the eggs! It seems a greater threat looms. The Gnarlpine remain tainted by something most foul."

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creature text non exist in broadcast_text,seems wrong.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to video,This script seems wrong.

#define TARINDRELLA_TEXT_SPAWN "You've come to help, $c? Let us stay together for a while."
#define TARINDRELLA_TEXT_ON_KILL "My dear friends... I'm so sorry..."
class npc_tarindrella : public CreatureScript
{
public:
npc_tarindrella() : CreatureScript("npc_tarindrella") { }
bool OnQuestComplete(Player* player, Creature* creature, Quest const* quest) OVERRIDE
{
if (player->GetQuestStatus(QUEST_VILE_TOUCH) == QUEST_STATUS_COMPLETE)
creature->MonsterSay(TARINDRELLA_TEXT_ON_COMPLETE, Language::LANG_UNIVERSAL, player);
return true;
}
bool OnQuestReward(Player * player, Creature * creature, Quest const* quest, uint32 /*opt*/) OVERRIDE
{
if (player->GetQuestStatus(QUEST_VILE_TOUCH) == QUEST_STATUS_REWARDED)
creature->DespawnOrUnsummon();
return true;
}
struct npc_tarindrellaAI : public FollowerAI
{
npc_tarindrellaAI(Creature* creature) : FollowerAI(creature) { }

void MoveInLineOfSight(Unit* who) OVERRIDE
{
FollowerAI::MoveInLineOfSight(who);
}

void IsSummonedBy(Unit* unit) OVERRIDE
{
me->MonsterSay(TARINDRELLA_TEXT_SPAWN, Language::LANG_UNIVERSAL, unit);
}

void KilledUnit(Unit* /*victim*/) OVERRIDE
{
me->MonsterSay(TARINDRELLA_TEXT_ON_KILL, Language::LANG_UNIVERSAL, me->GetOwner());
}

void Reset() OVERRIDE
{
events.ScheduleEvent(EVENT_ENTANGLING_ROOTS, 2000);
events.ScheduleEvent(EVENT_SUMMON_NATURES_BITE, 6000);
events.ScheduleEvent(EVENT_CLEANSE_SPIRIT, 10000);
}

void UpdateFollowerAI(const uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;

events.Update(diff);

while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_ENTANGLING_ROOTS:
{
DoCast(me->GetVictim(), SPELL_ENTANGLING_ROOTS);
events.ScheduleEvent(EVENT_ENTANGLING_ROOTS, 10000);
break;
}
case EVENT_CLEANSE_SPIRIT:
{
if (me->HasAura(6751))
{
DoCast(me, SPELL_ENTANGLING_ROOTS);
events.ScheduleEvent(EVENT_CLEANSE_SPIRIT, 10000);
}
else if (me->GetOwner()->HasAura(6751))
{
DoCast(me->GetOwner(), SPELL_ENTANGLING_ROOTS);
events.ScheduleEvent(EVENT_CLEANSE_SPIRIT, 10000);
}
else
{
events.ScheduleEvent(EVENT_CLEANSE_SPIRIT, 10000);
}
break;
}
case EVENT_SUMMON_NATURES_BITE:
{
DoCast(me->GetVictim(), SPELL_SUMMON_NATURES_BITE);
events.ScheduleEvent(EVENT_SUMMON_NATURES_BITE, 10000);
break;
}
default:
break;
}
}
DoMeleeAttackIfReady();
}
EventMap events;
};

CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_tarindrellaAI(creature);
}
};

/*####
# npc_mist
####*/
Expand Down Expand Up @@ -130,6 +248,7 @@ class at_barrow_den_door : public AreaTriggerScript

void AddSC_teldrassil()
{
new npc_tarindrella();
new npc_mist();
new at_barrow_den_door();
}
Loading