• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Arcing Loot

This bundle is marked as lacking. It fails to meet the standard requirements and may only have minor use.
dcfad2d6c861e69f5a72bd08f54e1ba8.gif

GIF by @Killcide

Based on Zephyr Contest #14 - Unique Summoning along with ArcingLoot which I wrote in Zinc a few years back.

Uses my Recipe system and ArcingTextTag by Maker, converted to wurst by me.


Put items in the cauldron and press esc to make it it spit out a crafted item!​


Wurst:
package ArcingLoot
import LinkedListModule
import TimerUtils
import Fx
constant real arc          = 75 //modifies the  arcing shape
constant real arcHeight    = 350 //how high the arc reach at its peak
constant real travelTime   = 0.9 //time it takes for the arc to reach destination
constant real convertArc   = arc / 100.00 // do not touch 
constant string sfx        = "Objects\\InventoryItems\\TreasureChest\\treasurechest.mdl" //effect, the item chest in this case
constant real loopSpeed    = 0.03 //how often the system runs its loop. Higher value equals better perfomance
constant location loc = Location(0,0)
function vec2.getZ() returns real
    MoveLocation(loc, this.x, this.y)
    return GetLocationZ(loc)
public class ArcingItem
    use LinkedListModule
    static timer t
    integer id
    Fx fx
    angle angle
    real distance
    real maxDistance
    real arc
    real speed
    effect e
    vec2 pos
    vec2 destination
    construct(integer itemId, vec2 start, vec2 dest)
        pos          = start
        fx           = new Fx(pos, angle(0), sfx)
        angle        = pos.angleTo(dest)
        distance     = pos.distanceTo(dest)
        maxDistance  = distance
        speed        = distance / (travelTime / loopSpeed)
        destination  = dest
        arc          = distance * convertArc
        id           = itemId
        e = fx.getDummy().addEffect("Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl", "origin")
        if(t == null)
            t = getTimer()
            t.startPeriodic(loopSpeed, function ArcingItem.onLoop)
    static function onLoop()
        for instance in ArcingItem
            instance.update()
   
    function update()
        pos.x = pos.x + speed * Cos(angle.radians)
        pos.y = pos.y + speed * Sin(angle.radians)
        distance = pos.distanceTo(destination)
        let tarc     = (4.00 * arc) / maxDistance
        let dist    = (maxDistance - distance) * (distance / maxDistance)
        let z       = pos.getZ()
        let height  = (tarc * dist) + z
        fx.getDummy().setPosFly(vec3(pos.x, pos.y, height))
        if(height <= 0)
            e.destr()
            createItem(id, pos)
            destroy fx
            destroy this
            if ArcingItem.size == 0
                t.destr()


Demo

Wurst:
package demo
import ChannelAbilityPreset
import ArcingLoot
string onCraftEffect = "Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl"
integer testUnit = compiletime(UNIT_ID_GEN.next())
@compiletime function generate()
    new UnitDefinition(testUnit, 'hkni')
    ..setName("Witch's Cauldron")
    ..setModelFile("Doodads\\LordaeronSummer\\Props\\CauldronWithHeads\\CauldronWithHeads.mdl")
    ..setHitPointsMaximumBase(1)
    ..setMovementType(MovementType.None)
    ..setSpeedBase(0)
    ..setNormalAbilities("AInv,Avul")
    ..setArmorType(ArmorType.Unarmored)
    ..setDefenseBase(0)
    ..setAttack1DamageBase(0)
    ..setAttack1DamageNumberofDice(0)
    ..setAttack1DamageSidesperDie(0)
    ..setAttack1AttackType(AttackType.Unknown)
    ..setUnitSoundSet("")
    ..setScalingValue(1.5)
    ..setSightRadiusDay(0)
    ..setSightRadiusNight(0)
unit cauldron
init
    cauldron = createUnit(players[0], testUnit, vec2(0, 0), angle(0))
   
    // Press Esc to spawn an arcing item spit out from the Caultdron
    CreateTrigger()
    ..registerPlayerEvent(players[0], EVENT_PLAYER_END_CINEMATIC)
    ..addAction() ->
        new ArcingItem('phlt', cauldron.getPos(), cauldron.getPos().polarOffset(angle(GetRandomDirectionDeg()), GetRandomReal(200, 400)))
Contents

Arcing Loot (Map)

Reviews
Cokemonkey11
Uses the very outdated wurst standard library v1 With some minor effort this could become recommended

sentrywiz

S

sentrywiz

Oh this is so sweet... flying coins and items. Gonna test!
 
Hey @Chaosy this looks pretty cool

Is this something you have some time to tidy up so I can approve it?

Feedback:

 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
Simplified the demo, simplified for loop, fixed a big whoopsie with the timer. From what I can tell it works without changes with the standard lib v2.

The effect is now showing up though which might be a reforged issue possibly.
Code:
fx.getDummy().addEffect("Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl", "origin")

tried with both origin and chest. Could be that the path has also changed.. will look into it at some point.

TLDR, I wouldn't approve it yet but it's slightly better than before.
 
@Chaosy thanks for making progress on this

Here's a few minor points to consider while you iterate:

1. Can you use the Assests/Effects package to refer to constants like RejuvinationTarget?
2. Please omit the type when it can be inferred by the reader, i.e. string onCraftEffect = "Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl" -> constant onCraftEffect = ...
3. Please use UPPER_CAMEL for constants, usually
4. Please omit "extra" brackets in conditionals, i.e. if(foobar) -> if foobar

Progress looks good so far!
 
Top