Jump to content

[patch][8541] Implementing implicit target 72, 86.


Guest qsa

Recommended Posts

What bug does the patch fix? What features does the patch add?

Implementing implicit target TARGET_RANDOM_NEARBY_LOC (72), TARGET_RANDOM_NEARBY_DEST(86)

used combined in 279 spells.

       id   spellname_0       25301   Angry Turkey       29809   Desecration Arm       30009   Summon Robot       30170   Summon Bone Skeletons       34674   Explosion       36446   Test Nearby Dest Random       36572   Wyatt Test 36572       36845   Summon Shadow Horror       36931   Summon 66% Illusion       36932   Summon 33% Illusion       37091   Rain of Bones       37141   Acid Geyser       38139   Summon Wave D Mob       38939   Inferno       39146   Throw Orange Juice Bottle       39147   Throw Tar Bottle       39148   Throw Blood Bottle       39154   Throw Acid Bottle       39155   Throw Grape Juice Bottle       39161   Drop Totem       39163   [DND]Rescue Wyvern       39166   Feathery Cyclone Burst       39538   ZapTemp       39620   Summon Ogre Ghost       39829   Light of the Naaru       40118   Volcanic Geyser       40234   OCW Auchindoun Summon Adventurer       40235   OCW Auchindoun Summon Portal       40324   Feathery Cyclone Burst       40338   Summon Eagle Add       40629   Acid Geyser       40649   Mortar Shot       40750   Ethereal Ring Cannon, The Bolt Bunny       40784   Summon Stun Trap       40869   Fatal Attraction       41089   Volley       41159   Summon Shadowfiends       41289   Ethereal Ring, Signal Flare       41441   Acid Geyser       41479   Vanish       41485   Deadly Poison       42388   Summon Scarlet Bud       42499   L70ETC Earthquake       42500   L70ETC Lightning Cloud       42501   L70ETC Rain of Fire       42651   Army of the Dead       42706   Cosmetic - Tiny Blue Fireball to Random Loc       42794   Holiday - Brewfest - Random Mug Fling       42827   Result: Split       43134   Hatch Spiderlings       43143   Halazzi Transform       43147   Feathery Cyclone Burst       43486   Summon Amani'shi Warriors       43487   Summon Amani Eagle       43962   Summon Amani'shi Hatcher       44040   Fumble       44387   Dragonflayer Ambush       44821   Ball Bounces off Player       44837   BLB - Port to Team B Side       44841   BLB - Port to Team A Side       44858   Snowball       44993   Capacitor Discharge       45208   Summon Lightning Bunny       45219   Shoot       45223   Shoot       45229   Shoot       45233   Shoot       45253   Summon Sky Lightning Bunny       45311   Volley Visual Pulse       45340   Summon Amani'shi Hatcher       45490   Egg Burst       45494   Army of the Dead       45503   Planting Seaforium Depth Charge       45531   Devouring Creep       45613   Necropolis Beam       45868   Chain Lightning       45891   Sinister Reflection Summon       45971   Ground Rockets       46019   Teleport: Spectral Realm       46020   Teleport: Normal Realm       46037   Summon Berserker       46038   Summon Fury Mage       46039   Summon Fury Mage       46040   Summon Berserker       46071   Summon Void Spawn       46143   Summon Minion Missile, Minion 2       46176   Summon Minion Missile, Higher       46229   Summon Blazing Infernal       46241   Summon Felguard Slayer       46306   Create Doomfire Shard       46342   Drop Crate       46359   Summon Ice Spear Bunny       46363   Beam Attack against Ahune 2       46382   Summon Minion Missile, Minion 3       46396   Ice Bombardment       46585   Raise Dead       46670   Transborea Monster       46827   Big Flame Dancer       46829   Ribbon Pole Firework and Flame Patch       46847   Ribbon Pole Firework       46849   Raelorasz' Flare       47303   Summon Anub'ar Invader       47304   Warsong Battle Standard       47320   Toss Boulder 2       47482   Leap       47919   Call Xink's Shredder       48715   Summon Smoldering Skeleton       48718   Summon Smoldering Construct       48731   Quarterflash's Homing Bot       48741   Planting Wintergarde Mine Bomb       49068   Summon Frigid Ghoul       49100   Army of the Dead       49304   Summon Frigid Necromancer       49327   Racer Slam, death scene: debris       49329   Summon Frigid Ghoul Attacker       49342   Frost Breath       49353   Racer Slam, death scene: car flip Get Dest       49743   Summon Ruby Flowers       49744   Summon Ruby Flowers       49745   Summon Ruby Flowers       49750   Honey Touched       49798   BOTM - Flowery Brew - Summon Flowers       49809   Minions of Thel'zan       49815   Mine       49900   Summon Infinite Assailant       49901   Summon Infinite Destroyer       49902   Summon Infinite Chrono-Magus       49905   Summon Infinite Timerender       50095   [DND] BOTM - Honey Brew - Rooted       50180   Summon Pink Elekk Guardian       50298   Boulder Miss       50560   Summon Conquest War Rider       50790   Summon Iron Dwarf       50791   Summon Iron Dwarf       50793   Summon Iron Trogg       50794   Summon Iron Dwarf       50802   Summon Malformed Ooze       50803   Summon Malformed Ooze       50825   Summon Earthen Dwarf       50826   Summon Earthen Dwarf       50934   L70ETC Earthquake SMALLER       51036   Summon Venture Co. Air Patrol       51186   Summon Goregek the Bristlepine Hunter       51188   Summon Dajik the Wasp Hunter       51189   Summon Zepik the Gorloc Hunter       51190   Summon Lafoo       51191   Summon Jaloot       51192   Summon Moodle       51371   Apple Falls to ground       51397   Dig Up Shining Crystal       51398   Dig Up Glinting Armor       51400   Dig Up Glowing Gem       51401   Dig Up Polished Platter       51402   Dig Up Sparkling Treasure       51435   Summon Skimmer       51441   Dig Up Sparkling Hare       51443   Dig Up Glinting Bug       51511   Toss Ice Boulder       51590   Toss Ice Boulder       51813   The Leaders at Jin'Alai: Summon the Treasure of Chulo the Mad       51814   The Leaders at Jin'Alai: Summon the Treasure of Gawanil       51815   The Leaders at Jin'Alai: Summon the Treasure of Kutube'sa       51942   Spear Throw       52059   Axe Throw       52064   Throw Bomb       52121   Blood Maggot       52150   Raise Dead       52232   Summon Alarmed Blightguard       52276   Summon Kartak       52333   Summon Soo-holu       52364   Teleport Defenders       52439   Summon Skittering Swarmer       52450   Summon Skittering Infector       52494   Capacitor Discharge       52616   Summon Drakkari Chieftain       52636   Time Shift       52664   Random Lightning Visual Effect       52746   Summon Spark       52832   Dalaran Flower Grow - Summon Flowers       52917   Dig Up Disgruntled Bug       52965   Spark Frenzy       53447   WotLK Prologue Frozen Shade, Summon       53525   Summon Frigid Bones       54258   Water Globule       54264   Water Globule       54265   Water Globule       54266   Water Globule       54267   Water Globule       54664   Vrykul Bowshot Missed       54686   WotLK - Frost Wyrm - Frost Blast       54751   Electromagnetic Discharge       54768   Summon Icefang       54969   Summon Constrictor       55028   Summon Freed Proto-Drake       55060   Summon Viper       55433   Summon Flower       55528   Summon Earthen       55859   Jormungar Spawn       55872   Orb of Flame       55881   Hurricane       55882   Orb of Storms       55886   Boulder       55888   Orb of Water       55938   Hungry Penguins       55946   Summon Whisker       55957   Ride Snorri       56243   Summon Iron Dwarf       56323   Spark Frenzy       56328   Random Lightning Visual Effect       56429   Summon Arcane Bomb       56510   Activate Mobile Databank       56915   Random Lightning Visual Effect       57583   Icecrown Airship - H - Attack - 03 Cannon Fire       57584   Summon Ruby Flowers       57597   Summon Dahlia's Tears       57697   Lava Strike       57945   Icecrown Airship - A - Attack - 03 Cannon Fire       58035   Summon Twilight Whelp       58689   Rock Shards       58692   Rock Shards       58826   Summon Sartharion Twilight Whelp       58867   Spirit Wolf Leap       60055   Summon Plague Drenched Ghoul       60056   Summon Rampaging Ghoul       60058   Summon Living Plague       60322   Scroll of Recall       60887   Summon Infinite Timerender       60978   Ominous Cloud       61084   Time Shift       61089   Zombie Horde       61097   Incarnation       61098   Zombie Horde       61108   Incarnation       61116   Copy of Incarnation       61149   Ember Shower       61383   Army of the Dead       61564   Summon Crystalline Tangler       61586   Lightning Marker Visual Effect       61727   Summon Baby Bunny       61739   Fan of Knives       61740   Fan of Knives       61741   Fan of Knives       61742   Fan of Knives       61743   Fan of Knives       61744   Fan of Knives       61745   Fan of Knives       61746   Fan of Knives       61884   Lightning Tendrils       62189   Summon Black Hole       62273   Rune of Summoning       62572   Lifebinder's Gift Trigger Missile       62582   Healthy Spore Summon - NW       62591   Creature - Healthy Spore Summon (NE)       62592   Creature - Healthy Spore Summon (SE)       62593   Creature - Healthy Spore Summon (SW)       62828   Recharge Robot       62831   Recharge Robot       62835   Recharge Robot       62870   Lifebinder's Gift Trigger Missile       62899   Summon Mole Machine       62916   Summon Razorscale Dwarf       62947   Freya's Ward       63019   Displace Roots       63257   Explosive Fishin'       63496   Explosive Fishin'       63497   Explosive Fishin'       63634   Summon Rubble       63736   cdubinfourteen       64040   Summon Angry Oak Spirit       64139   Crusher Tentacle       64143   Corruptor Tentacle       64158   Immortal Guardian       64397   Summon Swarming Guardian       64399   Pounce       64470   Summon Void Zone Visual       64563   Summon Flames Initial       64612   Self-Destruction       64769   Laser Barrage       64784   Random Lightning Visual Effect   

PS: if you're using this and my other patch with summon types, "army of the dead" should work now.

For which repository revision was the patch created?

8526

Who has been writing this patch? Please include either forum user names or email addresses.

Me

Patch:

diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 53948c7..e10fb1d 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -1052,6 +1052,7 @@ enum Targets
    TARGET_AREAEFFECT_PARTY_AND_CLASS  = 61,
    TARGET_DUELVSPLAYER_COORDINATES    = 63,
    TARGET_BEHIND_VICTIM               = 65,                // uses in teleport behind spells, caster/target dependent from spell effect
+    TARGET_RANDOM_NEARBY_LOC           = 72,                // " ... onto nearby locations"
    TARGET_DYNAMIC_OBJECT_COORDINATES  = 76,
    TARGET_SINGLE_ENEMY                = 77,
    TARGET_POINT_AT_NORTH              = 78,                // 78-85 possible _COORDINATES at radius with pi/4 step around target in unknown order, N?
@@ -1062,6 +1063,7 @@ enum Targets
    TARGET_POINT_AT_NW                 = 83,                // from spell desc: "(NW)"
    TARGET_POINT_AT_SE                 = 84,                // from spell desc: "(SE)"
    TARGET_POINT_AT_SW                 = 85,                // from spell desc: "(SW)"
+    TARGET_RANDOM_NEARBY_DEST          = 86,                // "Test Nearby Dest Random" - random around selected destination
    TARGET_SELF2                       = 87,
    TARGET_DIRECTLY_FORWARD            = 89,
    TARGET_NONCOMBAT_PET               = 90,
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index f7dc9fa..463c8b9 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1313,6 +1313,30 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)

    switch(targetMode)
    {
+        case TARGET_RANDOM_NEARBY_LOC:
+        {
+            float dest_x = m_caster->GetPositionX() + irand(-radius, radius);
+            float dest_y = m_caster->GetPositionY() + irand(-radius, radius);
+            float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT);
+            m_targets.setDestination(dest_x, dest_y, dest_z);
+
+            TagUnitMap.push_back(m_caster);
+            break;
+        }
+        case TARGET_RANDOM_NEARBY_DEST:
+        {
+            float dest_x = m_targets.m_destX + irand(-radius, radius);
+            float dest_y = m_targets.m_destY + irand(-radius, radius);
+            float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT);
+            m_targets.setDestination(dest_x, dest_y, dest_z);

+            if (radius > 0.0f)
+                // caster included here?
+                FillAreaTargets(TagUnitMap, dest_x, dest_y, radius, PUSH_DEST_CENTER, SPELL_TARGETS_AOE_DAMAGE);
+            else
+                TagUnitMap.push_back(m_caster);
+
+            break;
+        }
        case TARGET_TOTEM_EARTH:
        case TARGET_TOTEM_WATER:
        case TARGET_TOTEM_AIR:

Take care.

Link to comment
Share on other sites

Doesnt solves the issue with blank target 72 like 39161

target 86 tested on 37091,46342, 36446,42651

target 72 tested on 38139, 60322

As for you example.. hmm, I pretty sure it isn't working due to RequiresSpellFocus=1450

EDIT: tested -- you miss GO 185309 -- add it and that spell works like a charm.

almost forgot - thanks for reviewing and adding.

Take care.

Link to comment
Share on other sites

While this can be bad place to post it, it is related to the topic.

Found another case that fits exactly the same code.

TARGET_RANDOM_NEARBY_LOC_1(73) - 170 spells

tested on : 43447,62609, 43653, 65347, 54307

Can't see why it is different from TARGET_RANDOM_NEARBY_LOC, it just has much grater ranges.

Thanks in advance.

id    spellname_0
29234    Summon Spore
31903    Doomfire Strike
36723    Phoenix
37099    Lament of the Highborne: Ribbon of Souls
37115    Felcano
37395    Shadow Rain
37398    Shadow Rain
37400    Shadow Rain
37404    Shadow Rain
37410    Shadow Rain
38724    Magic Sucker Device (Success Visual)
38755    Summon Spore Strider
38981    Blink
39113    Blue Smoke Spew
39149    Throw Frosty Bottle
39256    Dustin's Undead Dragon Visual1
39257    Dustin's Undead Dragon Visual2
39280    Hellfire - The Exorcism, Jules threatens
39307    The Exorcism, Flying Skull Despawn
39855    Summon Tear of Azzinoth
40152    ZingTemp
40188    Summon Doom Blossom
40403    Summon Maiev
40693    Cage Trap
40854    Akama Soul Retrieve
40855    Akama Soul Expel
42266    Random Circumference Point Poison
42267    Random Circumference Point Bone
42274    Random Circumference Point Bone 2
42279    Random Circumference Point Poison
42304    ZingTemp2
42412    Throw Chum
42431    Creature - Summon Netherwhelp
42453    Summon Dark Iron Attacker
42522    Brewfest - Throw Brewfest Mug Bounce
42552    Summon Pumpkin Missile
42622    Fire Bomb
42623    Fire Bomb
42624    Fire Bomb
42625    Fire Bomb
42626    Fire Bomb
42627    Fire Bomb
42784    Wrath of the Astromancer
43034    Headless Horseman - Wisp Escape Missile
43053    Vampire Soul Expel
43055    Vampire Soul Retrieve
43081    Random Circumference Point Cannon Part 01
43082    Random Circumference Point Cannon Part 02
43097    Summon All Players
43302    Lightning Totem
43436    Fire Nova Totem
43444    Explosive Trap
43447    Freezing Trap
43449    Snake Trap
43652    Electrical Overload Arc
43653    Electrical Arc
43654    Electrical Arc
43655    Electrical Arc
43656    Electrical Arc
43659    Electrical Arc
44194    Phoenix
44265    Summon Arcane Sphere
44322    Summon Pure Energy
44349    Rush
44854    TrajTest
45392    Summon Demonic Vapor
46969    Ribbon Pole  Ground Flower
46992    Random Circumference Point Tree Trunk
46993    Random Circumference Point Tree Leaf
46994    Random Circumference Point Small Tree
47212    Summon Cub
47302    Summon Draknid Spiders
47309    Quest - Jormungar Explosion Summon Object
47387    Summon Iron Dwarf Attacker
47445    Unbarreled
47924    Quest - Jormungar Explosion Summon Object
47925    Quest - Jormungar Explosion Summon Object
48272    Let Them Not Rise!: Summon Rat
48351    Bombard the Ballistae: Ballista Bow
48352    Bombard the Ballistae: Ballista Frame
48353    Bombard the Ballistae: Ballista Missile
48354    Bombard the Ballistae: Ballista Wheel
49103    Summon Fetid Troll Corpse
49104    Summon Hulking Corpse
49105    Summon Risen Shadowcaster
49179    Summon Crystal Handler
49400    Summon Player Skeleton
49671    Summon Shadowfiend
49754    Watched
49950    BOTM - Jungle Brew - Jungle Madness Summon
50071    Summon Pumpkin Soldier Missile
50292    Imperial Eagle Flight Target
50648    Blink
50719    Conjure Snowflake
50770    Magic Pull
50829    Summon Warhorse
50998    Summon Sanguine Spirit
51017    Summon Arcane Beam
51050    Summon Dark Rune Shadowcaster
51051    Summon Iron Golem Custodian
51175    Summon Ley-Whelp
51224    Summon Raptor
51433    Summon Mindless Servant
51475    Summon Air Elemental
51507    Summon Shardling
51780    Summon Dark Rune Protector
52320    Hell Hath a Fury: Random Circumference Point Ice Chunk
52325    Explode Scourgewagon:Roller
52329    Explode Scourgewagon:Frame
52330    Explode Scourgewagon:Grill
52332    Explode Scourgewagon:Wheel
52405    Summon Molten Golem
52451    Summon Ghouls
52478    Summon Ghouls
52516    Burst at the Seams:Bone
52520    Explode Abomination:Meat
52523    Explode Abomination:Bloody Meat
52556    Summon Drostan
52560    Summon Blood of the Old God
52575    Fuel for the Fire:Troll Explosion
52578    Explode Troll:Meat
52580    Explode Troll:Bloody Meat
52611    Summon Skeletons
52612    Summon Skeletons
53336    Animate Bones
53521    Carrion Beetles
54296    Summon Argent Knight (Alliance)
54307    Summon Argent Knight (Horde)
54369    Summon Void Sentry
54455    Random Circumference Point Feather Brown
54456    Random Circumference Point Feather Red
54457    Random Circumference Point Feather Blue
54547    Summon Stormforged Raider
54623    Quest - Mammoth Explosion Summon Object
54627    Quest - Mammoth Explosion Summon Object
54628    Quest - Mammoth Explosion Summon Object
55047    Cold Hearted: Ice Shard Impact
56070    Summon Red Dragon Buddy
56134    Jump From Egg
56789    Summon Harpoon
56892    Drop Horn of Elemental Fury
58939    Summon Darion Morgraine
59086    Arc Weld
59933    Copy of Summon Minions
61055    Summon Bone Spiders
61056    Summon Bone Spiders
61240    Summon Wyrmrest Skytalon
62012    Summon Lonely Turkey
62067    Summon Faithful Mule
62076    Pack Mule
62609    Argent Squire
62642    Random Lightning Visual Arc Up Effect
62685    Summon Wave - 1 Mob
62686    Summon Wave - 3 Mob
62704    Elwynn Lamb
62746    Argent Gruntling
62807    Starlight
62823    Conjure Toasty Fire
62926    Summon Iron Dwarf Guardian
63081    Summon Saronite Vapors
63135    Summon Iron Dwarf Watcher
63385    Blow Apart Stone Block
63708    Summon Void Beast
63798    Summon Iron Vrykul
64133    Constrictor Tentacle
64139    Crusher Tentacle
64143    Corruptor Tentacle
64158    Immortal Guardian
64450    Summon Unleashed Dark Matter
65347    Proximity Mines

diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index bf03c45..2fd4216 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -1053,6 +1053,7 @@ enum Targets
    TARGET_DUELVSPLAYER_COORDINATES    = 63,
    TARGET_BEHIND_VICTIM               = 65,                // uses in teleport behind spells, caster/target dependent from spell effect
    TARGET_RANDOM_NEARBY_LOC           = 72,                // uses in teleport onto nearby locations
+    TARGET_RANDOM_NEARBY_LOC_1         = 73,
    TARGET_DYNAMIC_OBJECT_COORDINATES  = 76,
    TARGET_SINGLE_ENEMY                = 77,
    TARGET_POINT_AT_NORTH              = 78,                // 78-85 possible _COORDINATES at radius with pi/4 step around target in unknown order, N?
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 78215f9..4c58b82 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1314,6 +1314,7 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
    switch(targetMode)
    {
        case TARGET_RANDOM_NEARBY_LOC:
+        case TARGET_RANDOM_NEARBY_LOC_1:
        {
            float dest_x = m_caster->GetPositionX() + irand(-radius, radius);
            float dest_y = m_caster->GetPositionY() + irand(-radius, radius);

Link to comment
Share on other sites

  • 2 weeks later...

There is problem introduced in http://github.com/mangos/mangos/commit/e5046cd14d44c4bdc12226a30e0ab0b6764ef0c8

@@ -1361,9 +1360,8 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
{
radius *= sqrt(rand_norm()); // Get a random point in circle. Use sqrt(rand) to correct distribution when converting polar to Cartesian coordinates.
            float angle = 2.0 * M_PI * rand_norm();
-            float dest_x = m_targets.m_destX + cos(angle) * radius;
-            float dest_y = m_targets.m_destY + sin(angle) * radius;
-            float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT);
+            float dest_x, dest_y, dest_z;
+            m_caster->GetClosePoint(dest_x, dest_y, dest_z, 0.0f, radius, angle);
            m_targets.setDestination(dest_x, dest_y, dest_z);            

This part should not be there, simply since central coordinates taken from m_targets.m_destX / Y and not m_caster, Braking TARGET_RANDOM_NEARBY_DEST.

The other case is fine (TARGET_RANDOM_CIRCUMFERENCE_POINT).

Thanks in advance.

Link to comment
Share on other sites

I agree that this part not right chnaged but main reason of change has been remove wrong use

- float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT);

This line only work in 1 plane places as continents and will not work correctly for floors and undergrounds.

[added]Must be fixed in [8606]. Thank you for pointing to problem.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use