• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Pet System

Status
Not open for further replies.
Level 5
Joined
Feb 6, 2010
Messages
151
Hey can someone show me how to make a pet system. A regular hero summons a pet, the pet upgrades/levels every time the Hero levels. If the pet dies, the Hero can revive pet - exactly the same as the one that died. The pet always follows the hero, and engages battle same time as hero, but the hero can't the controll the pet movements or skills. Oh and it will be kl if u could add some extra stuff, like skills that effect the pet or hero, ty =). And i dont want a hero icon for the pet please, ty =).
 
Last edited:
Level 10
Joined
May 27, 2009
Messages
494
here are some helps or tips on how to make it. I'm using pet system in my map too :grin:

  • Pet summoned
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Summon Pet
    • (Triggering Unit) is in PetOwners Equal to False
  • Actions
    • Set TempPoint = (Position of (Triggering Unit))
    • Unit - Create 1 PetUnit for (Owner of (Triggering Unit))] at TempPoint facing Default building facing degrees
    • Set Pet[Player number of (Owner of(Triggering unit))] = (Last Created Unit)
    • Unit - Order (Last Created Unit) to Right-Click (Triggering Unit)
    • Unit - Add (Triggering Unit) to PetOwners
    • -------- Other Actions --------
    • Custom script: call RemoveLocation (udg_TempPoint)
  • Pet LevelUp
  • Events
    • Unit - Gains a Level
  • Conditions
    • (Triggering Unit) is in PetOwners Equal to True
  • Actions
    • Hero - Set Pet[(Player Number of (Owner of (Triggering Unit)))] Hero-level to (Level of (Triggering unit)), Show level-up graphics
    • -------- Other Actions --------
  • Pet Dies
  • Events
    • Unit - A unit dies
  • Conditions
    • (Dying Unit) Equal to Pet[Player Number of (Owner of (Triggering Unit))
  • Actions
    • -------- If your pet has items, this save its items --------
    • Set PetItems1(Player Number of (Owner of (Triggering Unit)) = Item-Type of (Item carried by (Triggering Unit) in slot 1
    • Set PetItems2(Player Number of (Owner of (Triggering Unit)) = Item-Type of (Item carried by (Triggering Unit) in slot 2
    • Set PetItems3(Player Number of (Owner of (Triggering Unit)) = Item-Type of (Item carried by (Triggering Unit) in slot 3
    • Set PetItems4(Player Number of (Owner of (Triggering Unit)) = Item-Type of (Item carried by (Triggering Unit) in slot 4
    • Set PetItems5(Player Number of (Owner of (Triggering Unit)) = Item-Type of (Item carried by (Triggering Unit) in slot 5
    • Set PetItems6(Player Number of (Owner of (Triggering Unit)) = Item-Type of (Item carried by (Triggering Unit) in slot 6
    • Set PetDead[Player number of (Owner of (Triggering Unit))] = True
    • Set PetUnitType[Player number of (Owner of (Triggering Unit))] = (Unit-type of (Triggering Unit))
    • Set PetUnitLevel[Player number of (Owner of (Triggering Unit))] = (Level of (Triggering Unit))
** You could change (Triggering Unit) to the "Pet" variable if you want in case of bugs.

  • Revive Pet
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • PetDead[Player number of (Owner of (Triggering Unit))] Equal to True
    • (Ability being cast) Equal to PetRevive
  • Actions
    • Set TempPoint = (Position of (Triggering Unit))
    • Unit - Create 1 PetUnitType[Player number of (Owner of (Triggering Unit))] for (Owner of (Triggering Unit))] at TempPoint facing Default building facing degrees
    • Hero - Set level of (Last Created Unit) to PetUnitLevel[Player number of (Owner of (Triggering Unit))]
    • Set PetDead[Player number of (Owner of (Triggering Unit))] = False
    • Set Pet[Player number of (Owner of(Triggering unit))] = (Last Created Unit)
    • Hero - Create PETItem1[(Player number of (Owner of (Triggering unit)))] and give it to (Last created unit)
    • Hero - Create PETItem2[(Player number of (Owner of (Triggering unit)))] and give it to (Last created unit)
    • Hero - Create PETItem3[(Player number of (Owner of (Triggering unit)))] and give it to (Last created unit)
    • Hero - Create PETItem4[(Player number of (Owner of (Triggering unit)))] and give it to (Last created unit)
    • Hero - Create PETItem5[(Player number of (Owner of (Triggering unit)))] and give it to (Last created unit)
    • Hero - Create PETItem6[(Player number of (Owner of (Triggering unit)))] and give it to (Last created unit)
    • Custom script: call RemoveLocation (udg_TempPoint)
hope this helps :mwahaha:

Don't forget to add the "Locust" Ability to your pet unit in order to be uncontrollable by your hero and about the icon, hero icons cannot be removed.... unless if you use a transparent BLP image all throughout or a BLP Image which everything it consists is only an alpha channel.. But i guess it is still clickable :D ...

btw. you could use hashtables to store items... to optimize the triggers if you know how to use them
 
Last edited:
Status
Not open for further replies.
Top