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

Already on GitHub? Sign in to your account

Fix for gluth #11540

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
10 participants
Contributor

flippy84 commented Jan 31, 2014

Added script effect for decimate and made so gluth eats zombies.

@MitchesD MitchesD commented on the diff Jan 31, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
}
void JustSummoned(Creature* summon) OVERRIDE
{
if (summon->GetEntry() == NPC_ZOMBIE)
- summon->AI()->AttackStart(me);
+ summon->AI()->AttackStart(summon->SelectNearestPlayer(200));
@MitchesD

MitchesD Jan 31, 2014

Contributor

this isn't right, zombies should move toward to Gluth

@flippy84

flippy84 Jan 31, 2014

Contributor

See http://www.youtube.com/watch?v=E8Y_LgD3Ch4
zombies do target the player there

@LuqJensen

LuqJensen May 20, 2014

Contributor

zombies should initially move towards gluth, only if attacked they should focus its attacker. aka they use react_defensive/reactive

@Vincent-Michael Vincent-Michael commented on an outdated diff Jan 31, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
};
-#define EMOTE_NEARBY " spots a nearby zombie to devour!"
+#define EMOTE_NEARBY "Gluth spots a zombie to devour!"
@Vincent-Michael

Vincent-Michael Jan 31, 2014

Member

move that in db

@Vincent-Michael Vincent-Michael commented on an outdated diff Jan 31, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
};
-#define EMOTE_NEARBY " spots a nearby zombie to devour!"
+#define EMOTE_NEARBY "Gluth spots a zombie to devour!"
+#define EMOTE_ENRAGE "Gluth becomes enraged!"

@joschiwald joschiwald and 1 other commented on an outdated diff Jan 31, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
};
-#define EMOTE_NEARBY " spots a nearby zombie to devour!"
+#define EMOTE_NEARBY "Gluth spots a zombie to devour!"
+#define EMOTE_ENRAGE "Gluth becomes enraged!"
+#define EMOTE_DECIMATE "Gluth decimates all nearby flesh!"
@joschiwald

joschiwald Jan 31, 2014

Member

use creature_text

@Vincent-Michael Vincent-Michael commented on an outdated diff Jan 31, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -67,19 +71,7 @@ class boss_gluth : public CreatureScript
{
// Do not let Gluth be affected by zombies' debuff
me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true);
- }
-
- void MoveInLineOfSight(Unit* who) OVERRIDE
-
- {
- if (who->GetEntry() == NPC_ZOMBIE && me->IsWithinDistInMap(who, 7))
- {
- SetGazeOn(who);
- /// @todo use a script text
- me->MonsterTextEmote(EMOTE_NEARBY, NULL, true);
- }
- else
- BossAI::MoveInLineOfSight(who);
+ me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_DECIMATE, true);
@Vincent-Michael

Vincent-Michael Jan 31, 2014

Member

i think its better target remove gluth in spell script

@joschiwald joschiwald commented on an outdated diff Jan 31, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
- if (me->GetVictim() && me->GetVictim()->GetEntry() == NPC_ZOMBIE)
+class spell_gluth_decimate : public SpellScriptLoader
+{
+ public:
+ spell_gluth_decimate() : SpellScriptLoader("spell_gluth_decimate") { }
+
+ class spell_gluth_decimate_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gluth_decimate_SpellScript);
+
+ void Decimate(SpellEffIndex)
@joschiwald

joschiwald Jan 31, 2014

Member

take a look at implementation in Spell::EffectScriptEffect and remove it there

@jackpoz jackpoz and 1 other commented on an outdated diff Feb 1, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -133,25 +129,71 @@ class boss_gluth : public CreatureScript
DoSummon(NPC_ZOMBIE, PosSummon[rand() % RAID_MODE(1, 3)]);
events.ScheduleEvent(EVENT_SUMMON, 10000);
break;
+ case EVENT_DEVOUR:
+ {
+ Creature* zombie = me->FindNearestCreature(NPC_ZOMBIE, 200);
+ if(zombie && me->IsWithinDist2d(zombie, 7))
@jackpoz

jackpoz Feb 1, 2014

Member

doesn't it make more sense to just look for a zombie in a 7 yards range in the first place ?

@flippy84

flippy84 Feb 1, 2014

Contributor

Yes, you're right, fixing it now.

@joschiwald joschiwald and 1 other commented on an outdated diff Feb 1, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
{
- me->Kill(me->GetVictim());
- me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
+ unit->SetHealth(unit->GetMaxHealth() / 20);
@joschiwald

joschiwald Feb 1, 2014

Member

use implementation of the old script, use dmg spell instead of sethealth

@flippy84

flippy84 Feb 1, 2014

Contributor

Old script doesn't ignore armor so health isn't reduced to 5%.

@joschiwald

joschiwald Feb 1, 2014

Member

add SPELL_ATTR0_CU_IGNORE_ARMOR

@joschiwald joschiwald commented on the diff Feb 1, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
{
- me->Kill(me->GetVictim());
- me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
+ int damage = unit->GetHealth() - unit->CountPctFromMaxHealth(5);
+
+ SpellInfo info = *sSpellMgr->GetSpellInfo(28375);
+
+ info.AttributesCu |= SPELL_ATTR0_CU_IGNORE_ARMOR;
@joschiwald

joschiwald Feb 1, 2014

Member

holy fuck

@gerripeach

gerripeach Feb 2, 2014

Contributor

and i thought u do things like that in spellmgr

@joschiwald

joschiwald Feb 3, 2014

Member
if (Unit* target = GetHitUnit())
{
    int32 damage = int32(target->GetHealth()) - int32(target->CountPctFromMaxHealth(5));
    if (damage > 0)
        GetCaster()->CastCustomSpell(SPELL_DECIMATE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, target, true);
}

and all is fine, maybe you need spell target conditions, and remove this entry check here
add SPELL_DECIMATE_DAMAGE to spell enum
about custom spell attr: http://collab.kpsn.org/display/tc/Spell+custom+attr+tc2

@bieleib92

bieleib92 Feb 9, 2014

info.AttributesCu |= SPELL_ATTR0_CU_IGNORE_ARMOR;

You should do this in spell_custom_attr (database) now.

@jackpoz

jackpoz May 20, 2014

Member

change this part of the code, don't modify SpellInfo fields in scripts

@ghost ghost assigned joschiwald Feb 1, 2014

@joschiwald joschiwald commented on the diff Feb 3, 2014

sql/updates/world/2014_02_01_00_world_creature_text.sql
@@ -0,0 +1,3 @@
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES (15932,0,0,'%s spots a zombie to devour!',16,0,0,0,0,0,'');
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES (15932,1,0,'%s becomes enraged!',41,0,0,0,0,0,'');
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES (15932,2,0,'%s decimates all nearby flesh!',41,0,0,0,0,0,'');
@joschiwald

joschiwald Feb 3, 2014

Member

all sql querys in one file, and add cleanup querys before insert

@jackpoz jackpoz commented on the diff May 20, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+ Creature* zombie = me->FindNearestCreature(NPC_ZOMBIE, 7);
+ if(zombie)
+ {
+ Talk(EMOTE_NEARBY);
+ me->AddUnitState(UNIT_STATE_NOT_MOVE);
+ me->SetTarget(zombie->GetGUID());
+
+ events.ScheduleEvent(EVENT_DEVOUR2, 500);
+ }
+ events.ScheduleEvent(EVENT_DEVOUR, RAND(5, 8) * 1000);
+ }
+ break;
+ case EVENT_DEVOUR2:
+ {
+ Creature* zombie = sObjectAccessor->GetCreature(*me, me->GetTarget());
+ me->Kill(zombie);
@jackpoz

jackpoz May 20, 2014

Member

is a NULL check required here ?

@jackpoz jackpoz commented on the diff May 20, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+ {
+ Talk(EMOTE_NEARBY);
+ me->AddUnitState(UNIT_STATE_NOT_MOVE);
+ me->SetTarget(zombie->GetGUID());
+
+ events.ScheduleEvent(EVENT_DEVOUR2, 500);
+ }
+ events.ScheduleEvent(EVENT_DEVOUR, RAND(5, 8) * 1000);
+ }
+ break;
+ case EVENT_DEVOUR2:
+ {
+ Creature* zombie = sObjectAccessor->GetCreature(*me, me->GetTarget());
+ me->Kill(zombie);
+ Unit* unit = SelectTarget(SELECT_TARGET_TOPAGGRO);
+ me->SetTarget(unit->GetGUID());
@jackpoz

jackpoz May 20, 2014

Member

is a NULL check required here ?

@jackpoz jackpoz commented on the diff May 20, 2014

src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
{
- me->Kill(me->GetVictim());
- me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
+ int damage = unit->GetHealth() - unit->CountPctFromMaxHealth(5);
@jackpoz

jackpoz May 20, 2014

Member

is this throwing any warning about unsigned to signed integer conversion ? Please use int32 anyway instead of int

Member

jackpoz commented May 20, 2014

Overall this PR contains some required changes before being merged, please update it to a more recent commit since we can't automatically merge it either.

Owner

Aokromes commented Jun 8, 2014

We can’t automatically merge this pull request.

Use the command line to resolve conflicts before continuing.

Member

jackpoz commented Jun 9, 2014

It's not supposed to be merged anyway, there are some pending required changes.

@Shauren Shauren closed this Jun 23, 2014

@Aokromes Aokromes reopened this Jun 23, 2014

Member

jackpoz commented Aug 23, 2014

Fix the reported issues then contact a developer to reopen the pull request.
Please squash too.

@jackpoz jackpoz closed this Aug 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment