• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Spelldamage

Status
Not open for further replies.
Level 4
Joined
Dec 15, 2007
Messages
108
hi, i have made an integer variable which shall counts the speldmg incrase. but it is a bit bugged. so guys maybe a have a better idea how i can make items which incrase spelldmg like in the black road or maybe someone has this trigger from black road.

my idea was that a unit takes an item then the integer grow up and when the hero is loosing the item then remove the spelldmgbonus

  • GetBonus
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If ((Item-type of (Item being manipulated)) Equal to Ring of the Old Mages (1)) then do (Set SpelldamageP[(Player number of Speller)] = (Spellincrease[(Player number of (Owner of (Triggering unit)))] + 5)) else do (Do nothing)
      • If ((Item-type of (Item being manipulated)) Equal to test) then do (Set SpelldamageP[(Player number of Speller)] = (Spellincrease[(Player number of (Owner of (Triggering unit)))] + 1000)) else do (Do nothing)
this is for get the spelldmg

  • LoseBonus
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If ((Item-type of (Item being manipulated)) Equal to Ring of the Old Mages (1)) then do (Set SpelldamageP[(Player number of Speller)] = (Spellincrease[(Player number of (Owner of (Triggering unit)))] - 5)) else do (Do nothing)
      • If ((Item-type of (Item being manipulated)) Equal to test) then do (Set SpelldamageP[(Player number of Speller)] = (Spellincrease[(Player number of (Owner of (Triggering unit)))] - 1000)) else do (Do nothing)

and this for loosing it

so and this is for example a spell

  • holy smite
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Smite
    • Actions
      • Wait 0.30 seconds
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (Real((((Intelligence of (Triggering unit) (Include bonuses)) x 2) + SpelldamageP[(Player number of Speller)]))) damage of attack type Spells and damage type Normal
so when i take now an item and drop it and doing that often i have a really big differnces between the first take up and the tenth

(variablen definition: Speller (Player(player))
SpelldmgP (Integer(integer) Array(1)) )

thx for help where my misstake could be or tell me another way how to do thx
 
Last edited by a moderator:
Level 15
Joined
Jan 16, 2008
Messages
1,244
Ouch! You used wait. Variables such as target of ability being cast are deleted unless assigned to something right away. That means your target is gone by the time wait order is complete. Here is my advice. Set the first action to be:
Set target = target of ability being cast
Then you may add wait and replace every reference to target of ability being cast with the 'target' variable. I think that will solve your problem.
 
Level 4
Joined
Dec 15, 2007
Messages
108
when the unit moves it isnt a prob only when caster moves but its such a short w8 that u have to cast and the already must do something else but how i remove that with custom script what u said?

but what i have to do with the spelldmg?
 
Level 15
Joined
Jan 16, 2008
Messages
1,244
do as i said in the upper post. To null handles with custom script, try checking some tutorials in the Jass section. It is really not that hard, just find the null script for the data type you need, copy it in the header and call it via custom script action. Beware to input all the required data, otherwise your WE will crash...
 
Level 4
Joined
Dec 15, 2007
Messages
108
in another forum they found my mistake at the spelldmg integer i do behind spellincrase^^ i though that was my mistake but i have to test it
 
Status
Not open for further replies.
Top