WoWManiaUK / Blackwing-Lair

WoW-Reign - Blackwing Lair - 4.3.4 PvP Realm
https://wow-reign.com/
27 stars 13 forks source link

[Misc Item] Loot-a-Rang + Gnomish Gravity Well #3295

Open Venom64bit opened 5 years ago

Venom64bit commented 5 years ago

Links: Item: https://www.wowhead.com/item=60854/loot-a-rang Spell: https://www.wowhead.com/spell=140736/loot-a-rang

What is happening: The animation starts correctly but has no effect.

What should happen: It should allow you to collect all the loots from a corpse within 30y.

Rushor commented 5 years ago

will combine those special items to one ticket.

what i did for now, but crash

/// Loot-A-Rang - 84342  
class spell_item_loot_a_rang : public SpellScriptLoader
{
    public:
        spell_item_loot_a_rang() : SpellScriptLoader("spell_item_loot_a_rang") { }

        class spell_item_loot_a_rang_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_item_loot_a_rang_SpellScript);

            void HandleAfterCast()
            {
                Unit* l_Caster = GetCaster();
                if (!l_Caster || l_Caster->GetTypeId() != TYPEID_PLAYER)
                    return;

                SpellInfo const* l_SpellInfo = GetSpellInfo();
                if (!l_SpellInfo)
                    return;

                float l_Radius = 30.0f;

                std::list<Unit*> l_CreatureList;
                float x, y, z;
                l_Caster->GetPosition(x, y, z);
                {
                    CellCoord pair(Trinity::ComputeCellCoord(x, y));
                    Cell cell(pair);
                    cell.SetNoCreate();                    

                    const float searchDist = 30.f;
                    Trinity::AnyDeadUnitObjectInRangeCheck check(l_Caster, searchDist);
                    Trinity::UnitListSearcher<Trinity::AnyDeadUnitObjectInRangeCheck> searcher(l_Caster, l_CreatureList, check);
                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyDeadUnitObjectInRangeCheck>, GridTypeMapContainer> cSearcher(searcher);

                    cell.Visit(pair, cSearcher, *(l_Caster->GetMap()), *l_Caster, l_Radius);
                }

                if (l_CreatureList.empty())
                    return;

                l_Caster->ToPlayer()->SendLoot((*l_CreatureList.begin())->GetGUID(), LOOT_CORPSE);
            }

            void Register() override
            {
                AfterCast += SpellCastFn(spell_item_loot_a_rang_SpellScript::HandleAfterCast);
            }
        };

        SpellScript* GetSpellScript() const override
        {
            return new spell_item_loot_a_rang_SpellScript();
        }
};
Rushor commented 5 years ago

Links: Item: https://www.wowhead.com/item=40727/gnomish-gravity-well

What is happening: When use notify me that I am in the wrong zone.

What should happen: Usable multiple times in rapid succession until it overheats for a vertical jump effect. However, it CANNOT be used... -In Combat -In non-flying zones. -In Battlegrounds -In Instances -In Arenas

Youtube Video: https://www.youtube.com/watch?v=ECEqWY43Xjs The video shows an item that has the exact same effect, but updated to a more recent patch.