• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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?
 
Level 7
Joined
Jul 9, 2008
Messages
253
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?
 
Level 7
Joined
Oct 14, 2008
Messages
340
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.
 
Level 16
Joined
Feb 22, 2006
Messages
960
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
 
Level 7
Joined
Jul 9, 2008
Messages
253
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.
Top