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

Siphon Gold Spell Question

Status
Not open for further replies.
Level 1
Joined
May 23, 2004
Messages
4
I was wondering how I could edit the script of siphon gold so that it would work for 6 levels and drain a specific gold amount. I tried to edit the script, but than it wouldnt drain any gold, in fact, it wouldnt let me target anyone or anything.

Also, i made a spell that increased attack by 10,000%, but the problem is, I dont see the character attacking "uber" fast. He attacks just slightly faster and thats it.
 
Level 6
Joined
Sep 17, 2005
Messages
276
well, its hard to say why it doesnt work - maybe post a screenshot or describe it more precisely. make sure you set the values for each level!

to the attack rate: did you write the 10000 with ,? maybe in your version its the value for 10%. try it without the , maybe this works :wink:
 
Level 2
Joined
Oct 30, 2005
Messages
7
Code:
Drain Gold
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Animate Dead
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Animate Dead for (Triggering unit)) Equal to 1
            Then - Actions
                Player - Add -1000 to (Owner of (Target unit of ability being cast)) Current gold
                Player - Add 1000 to (Owner of (Triggering unit)) Current gold
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Animate Dead for (Triggering unit)) Equal to 2
                    Then - Actions
                        Player - Add -2000 to (Owner of (Target unit of ability being cast)) Current gold
                        Player - Add 2000 to (Owner of (Triggering unit)) Current gold
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of Animate Dead for (Triggering unit)) Equal to 3
                            Then - Actions
                                Player - Add -3000 to (Owner of (Target unit of ability being cast)) Current gold
                                Player - Add 3000 to (Owner of (Triggering unit)) Current gold
                            Else - Actions
                                Floating Text - Create floating text that reads wtf? at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency

You should know how to get it from there.

On the +10.00 AIS, you can only get to a certain point until it doesent work. Try adding Agility instead.
 
Level 2
Joined
Oct 30, 2005
Messages
7
Rui said:
It should substract gold to the target unit of ability being cast not add.

-Rui

There is no subtract, just "Set" and "Add". Thats why its add -X000 gold.
 
Level 4
Joined
Mar 19, 2005
Messages
95
//Here comes my ultimate version of Siphon-Gold for a channeling ability:

//GIVE ME CREDITS IF YOU USE IT!!
//BTJ Systems are nearly as good as vex's

JASS:
function SiphonGold_SpellId takes nothing returns integer
return 'XXXX' //Your spell id
endfunction

function SiphonGold_GoldPerSecond takes integer level returns integer
return 10+5*level
endfunction

function SiphonGold_ExtraGoldFinishGold takes integer level returns integer
return 100+50*level
endfunction

function SiphonGold_AttachPoint takes nothing returns string
return "chest"
endfunction

function SiphonGold_TextTag_Caster takes texttag text,unit c, integer gold returns nothing
call SetTextTagVisibility(text,true)
call SetTextTagPosUnit(text,c,GetUnitFlyHeight(c))

call SetTextTagColor(text,255,0,177,0)      //text in rgba
call SetTextTagVelocity(text,0,0.022)   //Speed
call SetTextTagText(text,I2S(gold)+"!",0.023)      //Text and Size
call SetTextTagFadepoint(text,1)      //Duration Before Fading
call SetTextTagLifespan(text,2)       //Total Duration

call SetTextTagPermanent(text,false)  
endfunction

function SiphonGold_TextTag_Target takes texttag text,unit u, integer gold returns nothing
call SetTextTagVisibility(text,true)
call SetTextTagPosUnit(text,u,GetUnitFlyHeight(u))

call SetTextTagColor(text,255,0,177,0)      //text in rgba
call SetTextTagVelocity(text,0,0.022)   //Speed
call SetTextTagText(text,I2S(gold)+"!",0.023)      //Text and Size
call SetTextTagFadepoint(text,1)      //Duration Before Fading
call SetTextTagLifespan(text,2)       //Total Duration

call SetTextTagPermanent(text,false)  
endfunction

function SiphonGold_Main takes nothing returns nothing
local unit c=GetTriggerUnit()
local unit u=GetSpellTargetUnit()
local trigger ex=CreateTrigger()
local trigger fin=CreateTrigger()
local timer t=CreateTimer()
local integer s=GetSpellAbilityId()
local integer l=GetUnitAbilityLevel(c,s)
local integer gold=SiphonGold_GoldPerSecond(l)
call TriggerRegisterUnitEvent(ex,c,EVENT_UNIT_DEATH)
call TriggerRegisterUnitEvent(ex,c,EVENT_UNIT_SPELL_ENDCAST)
call TriggerRegisterUnitEvent(fin,c,EVENT_UNIT_SPELL_FINISH)
loop
   call TimerStart(t,1.00,false,null) 
   loop
      exitwhen GetTriggerExecCount(ex)>0 or TimerGetRemaining(t)==0.00
      call TriggerSleepAction(0)
   endloop
   exitwhen GetTriggerExecCount(ex)>0 or GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED)<=0
   if gold>GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED) then
   set gold= GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED)
endif
   call SiphonGold_TextTag_Caster(CreateTextTag(),c,gold)
   call SiphonGold_TextTag_Caster(CreateTextTag(),u,gold)
   call SetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED,-gold+GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED))
   call SetPlayerState(GetOwningPlayer(c),PLAYER_STATE_GOLD_GATHERED,gold+GetPlayerState(GetOwningPlayer(c),PLAYER_STATE_GOLD_GATHERED))
   call DestroyEffect(AddSpellEffectTargetById(s,EFFECT_TYPE_TARGET,u,SiphonGold_AttachPoint()))
   call DestroyEffect(AddSpellEffectTargetById(s,EFFECT_TYPE_CASTER,c,SiphonGold_AttachPoint()))
endloop
if GetTriggerExecCount(fin)>0 and GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED)>0 then
   call TriggerSleepAction(0)
   set gold=SiphonGold_ExtraGoldFinishGold(l)
   if gold>GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED) then
      set gold= GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED)
   endif 
   call SiphonGold_TextTag_Caster(CreateTextTag(),c,gold)
   call SiphonGold_TextTag_Caster(CreateTextTag(),u,gold)
   call SetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED,-gold+GetPlayerState(GetOwningPlayer(u),PLAYER_STATE_GOLD_GATHERED))
   call SetPlayerState(GetOwningPlayer(c),PLAYER_STATE_GOLD_GATHERED,gold+GetPlayerState(GetOwningPlayer(c),PLAYER_STATE_GOLD_GATHERED))
endif
call DestroyTrigger(fin)
call DestroyTrigger(ex)
call DestroyTimer(t)
set fin=null
set ex=null
set c=null
set t=null
set u=null
endfunction

function SiphonGold_Condition takes nothing returns boolean
return GetSpellAbilityId()==SiphonGold_SpellId()
endfunction

function InitTrig_SiphonGold takes nothing returns nothing
local trigger t=CreateTrigger()
local integer i=0
call TriggerAddAction(t,function SiphonGold_Main)
call TriggerAddCondition(t,Condition(function SiphonGold_Main))
loop
   exitwhen i>16 
   call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
   set i=i+1
endloop
set t=null
endfunction

So thats it!!

Don't forget to give credits to me for this script!!

Thx.
:D
 
Status
Not open for further replies.
Top