• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

meepo divided we stand

Status
Not open for further replies.
Level 4
Joined
Mar 15, 2011
Messages
39
How to schedule a hero multiple ?, three heroes behave as one, sharing the same experience level and determined items.
 
Sharing items is pretty easy, not quite sure if it's possible with the experience though.

edit: okay it's easy with experience as well. I can create the whole code for you, though I only work in vjass these days.

edit: I made some progress already. At the moment is simply shares the items when picked up. I need information to finish it.
If all units carry the same item, and one unit drops the item what happens to the other items? should they simply be removed from the inventory?


JASS:
//! zinc
    library TextMacroList
    {
        //! textmacro LIST takes NAME, TYPE
            public struct $NAME$List
            {
                $TYPE$ List[999];
                integer index = 0;
                static method create() -> thistype
                {
                    thistype this = thistype.allocate();
                    return this;
                }
                
                method Add($TYPE$ value)
                {
                    List[index] = value;
                    index += 1;
                }
                
                method AddAt(integer i, $TYPE$ value)
                {
                    List[index] = List[i];
                    List[i] = value;
                    index += 1;
                }
                
                method RemoveAt(integer i)
                {
                    List[i] = List[index - 1];
                    index -= 1;
                }
                
                method first() -> $TYPE$
                {
                    return List[0];
                }
                
                method last() -> $TYPE$
                {
                    return List[index - 1];
                }
                
                method size() -> integer
                {
                    return index;
                }
                
            }
        //! endtextmacro
        //! runtextmacro LIST("Integer", "integer")
		//! runtextmacro LIST("Unit"   , "unit"   )
    }
//! endzinc
JASS:
//! zinc
	library HeroShareCore requires TextMacroList
	{
		hashtable hash = InitHashtable();
		boolean bypass = false;
		public struct HeroBond
		{
			UnitList list;
			
			static method create() -> thistype
			{
				thistype this = thistype.allocate();
				list = UnitList.create();
				return this;
			}
			
			method AddToBond(unit u)
			{	
				this.list.Add(u);
				SaveInteger(hash, GetHandleId(u), 0, this);
				
			}
			
		}
		
		function onPickup()
		{
			unit u = GetManipulatingUnit();
			integer id = LoadInteger(hash, GetHandleId(u), 0);
			integer number = HeroBond(id).list.index;
			integer i = 0;
			item drop = GetManipulatedItem();
			if(bypass == false)
			{
				while(i < number)
				{
					if(HeroBond(id).list.List[i] != u)
					{
						bypass = true;
						UnitAddItem(HeroBond(id).list.List[i], CreateItem(GetItemTypeId(drop), 0, 0));
						bypass = false;
					}
					i += 1;
				}
			}
			
		}
		
		function onInit()
		{
			trigger t = CreateTrigger();
			TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_PICKUP_ITEM);
			TriggerAddAction(t, function onPickup);
			t = null;
		}
	}
//! endzinc
JASS:
//! zinc
	library demo
	{
		function onInit()
		{
			HeroBond bond = HeroBond.create();
			bond.AddToBond(CreateUnit(Player(0), 'Hpal', 0, 0, 0));
			bond.AddToBond(CreateUnit(Player(0), 'Hpal', 0, 0, 0));
			bond.AddToBond(CreateUnit(Player(0), 'Hpal', 0, 0, 0));
		}
	}
//! endzinc
 
Last edited:
Here is a map with Dota`s Divided We Stand Spell i don`t claim it`s 100% complete but its almost complete

Features:
  • The Meepo`s Stat will be Shared with other Copies
  • you can specify a Class of item to be shared between Copies
  • Every Ability that the primary Meepo learns other Copies Learn it too
  • If one of the meepos Dies all of them will die too (works for Ress too)

Download
 
Status
Not open for further replies.
Back
Top