chrisinajar / MNIMode

DoTA 2 arena mode based on Dennis Mode.
1 stars 0 forks source link

Rune Spawners and shops? #1

Closed ash47 closed 11 years ago

ash47 commented 11 years ago

{ "origin" "3008 -2432 32" "targetname" "dota_item_rune_spawner" "classname" "dota_item_rune_spawner" "hammerid" "16675876" } { "origin" "-2272 1792 32" "targetname" "dota_item_rune_spawner" "classname" "dota_item_rune_spawner" "hammerid" "16675876" }

You should be able to simple do a

game.findEntitiesByClassname('dota_item_rune_spawner');

to find the rune spawners, then just move them, if that doesn't work, here's a function I use in builder:

// Spawns a rune, and returns it function GrabRune() { // Grab a copy of the original runes var oldRunes = game.findEntitiesByClassname('dota_item_rune');

// Spawn a new rune
dota.spawnRune();

// Grab the new runes
var runes = game.findEntitiesByClassname('dota_item_rune');

// Attempt to find the rune that just spawned
for(var i=runes.length-1;i>=0;i--) {
    var rune = runes[i];

    // Work backwards through the array looking for one that isn't in the oldRunes array
    if(oldRunes.indexOf(rune) == -1) {
        return rune;
    }
}

return null;

}

Basically, it makes a new rune, and returns a handle to it (or null, if it couldnt find it)

As far as the shops go, you're looking for

{ "model" "*40" "StartDisabled" "0" "spawnflags" "4097" "shoptype" "0" "origin" "-7584 -6688 293.9" "classname" "trigger_shop" "hammerid" "9974874" }

you basically want to move a trigger_shop into your arena (not sure if that's possible, but it has an origin, so it should be)

If that fails, another work around:

hero.netprops.m_iCurShop = 0; // Regular shop hero.netprops.m_iCurShop = 1; // Side Shop hero.netprops.m_iCurShop = 2; // Secret Shop hero.netprops.m_iCurShop = 3 - 6; // Not in a shop / I couldnt workout what it does

Just make a -secretshop command or something along those lines, which sets it so you're in the secret shop, or check if the heros is near a certain location, and set that var to the number you want, and it will highlight the shop menu and play the shop noise :P

chrisinajar commented 11 years ago

Oh awesome! I had figured out how to move the runes, but moving the runs spawners is a lot better.

For the secret shop, Fubar figured out that the game rules proxy actually has two references to the secret shops. I'd like to try that and see if it works, otherwise I'll just trigger that shop flag manually with a bounding box. I want it to be location dependent because I want people to fight over the middle.

Thanks a ton for the help! Hopefully find time tonight to add these...