Skip to content

Commit

Permalink
Do TODO
Browse files Browse the repository at this point in the history
Remove redundant call now we have GuardianAI
Don't allow guardians summoed by items to scale (unless they are
engineering trinkets, of course)
  • Loading branch information
Phatcat committed Sep 13, 2016
1 parent b586419 commit 6fb00d3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/game/SpellEffects.cpp
Expand Up @@ -5529,17 +5529,25 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
// TODO :: Totem, Pet and Critter may not use this
level += std::max(m_spellInfo->EffectMultipleValue[eff_idx], 1.0f);
}

// level of creature summoned using engineering item based at engineering skill level
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_CastItem)
else if (m_CastItem)
{
ItemPrototype const* proto = m_CastItem->GetProto();
if (proto && proto->RequiredSkill == SKILL_ENGINEERING && proto->InventoryType == INVTYPE_TRINKET)
{
if (uint16 engineeringSkill = ((Player*)m_caster)->GetSkillValue(SKILL_ENGINEERING))
{
level = engineeringSkill / 5;
amount = 1; // TODO HACK (needs a neat way of doing)
}
}
else if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(m_spellInfo->EffectMiscValue[eff_idx]))

This comment has been minimized.

Copy link
@VladimirMangos

VladimirMangos Sep 13, 2016

Member

How this part can be called if you guard all by if (m_CastItem)

This comment has been minimized.

Copy link
@Phatcat

Phatcat Sep 13, 2016

Author Contributor

This part is actually only supposed to be called if m_castItem, sorry for not being clear on that; this is a continuation of 62fe263

basically, we want guardians (pet not summoned via SummonPet, but...) summoed by spells (the mage's water elemental, the priests shadowfiend, etc) to scale with level, but all guardians summoed by items (target dummies, explosive sheeps, cat figurine, etc) to NOT scale, unless they of course are engineering trinkets (dragonlings, battle chicken, etc)

This comment has been minimized.

Copy link
@VladimirMangos

VladimirMangos Sep 13, 2016

Member

Ah, thanks for clarify. I misundestand code. cInfo related to summoned creature. )

This comment has been minimized.

Copy link
@Phatcat

Phatcat Sep 13, 2016

Author Contributor

Yeah, I see now how it appears, but this is actually because we're in the Spell Effect SummonType which apparently don't need creature info at all (done in all the various DoSummon effects) so I needed to call fetch cInfo here in order to get the right level range... this probably can be improved.

This comment has been minimized.

Copy link
@Phatcat

Phatcat Sep 13, 2016

Author Contributor

http://wowwiki.wikia.com/wiki/Mechanical_Dragonling

Patch changes

    Patch 4.1.0 - Mechanical Dragonlings are now always level 40 instead of scaling with the engineer's skill.
    Cooldown has been reduced to 5 minutes. 
Bc icon Patch 2.4.3 (2008-07-15): Mechanical Dragonlings once again scale with engineering skill.[citation needed]
Bc icon Patch 2.4.0 (25-Mar-2008):
    Mechanical Dragonlings are now always level 40 instead of scaling with the engineer's skill.[1]
    Engineering Dragonlings now have a 20 minute cooldown instead of 1 hour
WoW Icon 16x16 Patch 1.4.0 (2005-05-05): The level of the Mechanical Dragonlings now scale with your engineering skill, so they will be always useful against enemies. Their damage and health has remained the same.
WoW Icon 16x16 Patch 1.3.0 (07-Mar-2005): Mechanical Whelps have been boosted by five levels in order to be effective longer. Their damage has been slightly decreased to compensate for the additional damage that would have occurred with the change.

and this

Item Level 40

I'm seeing a connection here, how 'bout you guys? - I'm gonna try verifying this against other items summoning guardians...

Edit*: Scratch this, item levels went haywire exploded in later expansions

{
if (level >= cInfo->MaxLevel)
level = cInfo->MaxLevel;
else if (level <= cInfo->MinLevel)
level = cInfo->MinLevel;
}
}

CreatureSummonPositions summonPositions;
Expand Down Expand Up @@ -5711,13 +5719,7 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)

// Notify original caster if not done already
if (caster && caster->AI())
{
caster->AI()->JustSummoned(itr->creature);

// TODO: handling attack start here is not correct we do not check any react state before (REACT_PASSIVE ?)
if (caster->isInCombat() && !(itr->creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)))
itr->creature->AI()->AttackStart(m_caster->getAttackerForHelper());
}
}
}
}
Expand Down

0 comments on commit 6fb00d3

Please sign in to comment.