Locust Damage based on Hero Attribute

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

Locust Damage based on Hero Attribute

Post by JustANewbie »

JassCraft finds no error but the map just won't start, what is the problem?

Code: Select all

function Locust_Conditions takes nothing returns boolean
return(GetUnitTypeId(udg_GDD_DamageSource)=='u00D')or(GetUnitTypeId(udg_GDD_DamageSource)=='u008')
endfunction
function Locust_Actions takes integer Damage returns nothing
call UnitDamageTarget(udg_GDD_DamageSource,udg_GDD_DamagedUnit,Damage,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endfunction
function InitTrig_Locust takes nothing returns nothing
set gg_trg_Locust=CreateTrigger()
call DisableTrigger(gg_trg_Locust)
call TriggerRegisterVariableEvent(gg_trg_Locust,"udg_GDD_Event",EQUAL,0)
call TriggerAddCondition(gg_trg_Locust,Condition(function Locust_Conditions))
call TriggerAddAction(gg_trg_Locust,function Locust_Actions)
endfunction

Code: Select all

function LocustCast_Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A07A')or(GetSpellAbilityId()=='A065')
endfunction
function LocustCast_Actions takes nothing returns nothing
local integer array Damage
local integer CV
local unit array Caster
if CV<10 then
set CV=CV+1
else
set CV=0
endif
set Caster[CV]=GetTriggerUnit()
if GetUnitTypeId(Caster[CV])=='A07A' then
set Damage[CV]=GetHeroInt(Caster[CV],true)
else
set Damage[CV]=GetHeroAgi(Caster[CV],true)
endif
endfunction
function InitTrig_LocustCast takes nothing returns nothing
set gg_trg_LocustCast=CreateTrigger()
call DisableTrigger(gg_trg_LocustCast)
call TriggerRegisterAnyUnitEventBJ(gg_trg_LocustCast,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Fortitude,Condition(function LocustCast_Conditions))
call TriggerAddAction(gg_trg_LocustCast,function LocustCast_Actions)   
endfunction
Last edited by JustANewbie on November 20th, 2015, 9:32 am, edited 4 times in total.
User avatar
haxorico
Super Moderator
Posts: 3190
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND

Re: Locust Damage based on Hero Attribute

Post by haxorico »

we need both the unedited and edited MAPS to see what is wrong.
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?
JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

Re: Locust Damage based on Hero Attribute

Post by JustANewbie »

I believe the problem is with this specific trigger because this is the one I added, and when I remove this trigger, the map works. So basically what I'm doing is I'm using the GDD damage detection system to create a locust ability where the locust damage should based on the caster, recently I saw in a post of "The Helper" where it is about MUI triggers. From that tutorial, I've learned that by using a custom value when a unit cast a spell, it would be MUI. In this case, I have 2 heroes having the locust spell where they are agility based and intelligence based respectively. Please help me to analyse what is the problem or guide me to make this trigger. Thank you.