• 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!

Spelldamage and Healing

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2008
Messages
253
I'm making an RPG and i want that there are items that have Spelldamage/Healing bonus and when they cast a spell that damages/heales it does more. Any idea's how i do this?
 
Imagine: U have a Fire Bolt that does 100 damage and u have an item that gives u 50 Spell damage then i want it to do 150 damage, clear enough?
 
Well that's really easy if your damage is triggered, assuming you use GUI, use an if/then/else statement, checking if the unit casting the spell has your certain item, then increase the damage done.
 
omg why so difficult...
realy easy thing lets say, you create a variable named spelldamage[array].... then
a unit gathers an item... then say
set spelldamage[playernumber[owner of triggering unit]] = spelldamage[playernumber[owner of triggering unit]] + 50

then trigger the damage/heal spell.... order unit to damage unit equal to 100 + spelldamage[playernumber[owner of triggering unit]]

and if the unit drops the items :
set spelldamage[playernumber[owner of triggering unit]] = spelldamage[playernumber[owner of triggering unit]] - 50

simple solution in GUI
 
Ok I made what u said but I bumb on a problem ( i made it in jass btw) when i loot the item and drop it i still keep the healing even tho i made the trigger that removed the healing when dropped >.>

JASS:
function Trig_Amani_Punisher_Loot_Conditions takes nothing returns boolean
    return GetItemTypeId(GetManipulatedItem()) == 'I000'
endfunction

function Trig_Amani_Punisher_Loot_Actions takes nothing returns nothing
    local unit owner = GetTriggerUnit()
    set udg_Spellpower[GetConvertedPlayerId(GetOwningPlayer(owner))] = ( udg_Spellpower[GetConvertedPlayerId(GetOwningPlayer(owner))] + 217.00 )
endfunction

//===========================================================================
function InitTrig_Amani_Punisher_Loot takes nothing returns nothing
    set gg_trg_Amani_Punisher_Loot = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Amani_Punisher_Loot, EVENT_PLAYER_UNIT_PICKUP_ITEM )
    call TriggerAddCondition( gg_trg_Amani_Punisher_Loot, Condition( function Trig_Amani_Punisher_Loot_Conditions ) )
    call TriggerAddAction( gg_trg_Amani_Punisher_Loot, function Trig_Amani_Punisher_Loot_Actions )
endfunction

JASS:
function Trig_Amani_Punisher_Drop_Conditions takes nothing returns boolean
    return GetItemTypeId(GetManipulatedItem()) == 'I000'
endfunction

function Trig_Amani_Punisher_Drop_Actions takes nothing returns nothing
    local unit owner = GetTriggerUnit()
    set udg_Spellpower[GetConvertedPlayerId(GetOwningPlayer(owner))] = ( udg_Spellpower[GetConvertedPlayerId(GetOwningPlayer(owner))] - 217.00 )
endfunction

//===========================================================================
function InitTrig_Amani_Punisher_Drop takes nothing returns nothing
    set gg_trg_Amani_Punisher_Drop = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Amani_Punisher_Drop, EVENT_PLAYER_UNIT_DROP_ITEM )
    call TriggerAddCondition( gg_trg_Amani_Punisher_Drop, Condition( function Trig_Amani_Punisher_Drop_Conditions ) )
    call TriggerAddAction( gg_trg_Amani_Punisher_Drop, function Trig_Amani_Punisher_Drop_Actions )
endfunction

I dont see the problem... Do you?
 
Last edited:
Status
Not open for further replies.
Back
Top