• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Trigger] Bounty help

Status
Not open for further replies.
Level 3
Joined
Jun 27, 2008
Messages
34
ok so i want it were for income the undead and demons kill for income, but i don't want any other player to get income from killing other units but demons and undead. thanks for any help i really need this for my map:mwahaha:
 
Level 6
Joined
Mar 20, 2008
Messages
208
Create a trigger wit hthe event as a generic unit dies

set the condition to check if the killing unit's owner is Undead or Demons
if it is, then set their resources to += whatever the value you want it at and maybe play the gold effect over the dead dying units head.
if not, then do nothing.
 
Level 6
Joined
Jun 4, 2009
Messages
91
here is a good way :

JASS:
function Bounty takes player whichplayer, integer bounty, real x, real y returns nothing
 local texttag t=CreateTextTag()
 local string s="+"
    call AdjustPlayerStateBJ( bounty, whichplayer, PLAYER_STATE_RESOURCE_GOLD )
    if bounty<0 then
        set s=""
    endif
    call SetTextTagText(t,s+I2S(bounty),0.025)
    call SetTextTagPos(t,x,y, 0.00)
    call SetTextTagColor(t,255,220,0,255)
    call SetTextTagVelocity(t,0,0.03)
    if (GetLocalPlayer()==whichplayer) then
        call SetTextTagVisibility(t,true)
        set s="UI\\Feedback\\GoldCredit\\GoldCredit.mdl"
    else
        call SetTextTagVisibility(t,false)
        set s=""
    endif
    call DestroyEffect(AddSpecialEffect(s,x,y))
    call SetTextTagFadepoint(t,2)
    call SetTextTagLifespan(t,3)
    call SetTextTagPermanent(t,false)
 set t=null
endfunction
(source : http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=26359, thanks to ReVolver)

copy this to the custom script code of your map.

then do a trigger like this :
  • Bounty
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Triggering unit) is Undead) Equal to True
  • Actions
    • Custom script - call Bounty(GetOwningPlayer(GetKillingUnit()), BOUNTY_AMOUNT, GetWidgetX(GetDyingUnit()), GetWidgetY(GetDyingUnit()))
 
Level 6
Joined
Mar 20, 2008
Messages
208
JASS:
function Bounty takes player p, integer bounty, real x, real y returns nothing
 local texttag t

    if (GetLocalPlayer()==p and (GetLocalPlayer() == Player(10) or GetLocalPlayer() == Player(11))) then
           call SetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD)+bounty )


           set t =CreateTextTag()
           call SetTextTagText(t,"+"+I2S(bounty),0.025)
           call SetTextTagPos(t,x,y, 0.00)
           call SetTextTagColor(t,255,220,0,255)
           call SetTextTagVelocity(t,0,0.03)
           call SetTextTagVisibility(t,true)
           call SetTextTagFadepoint(t,2)
           call SetTextTagLifespan(t,3)
           call SetTextTagPermanent(t,false)
    
           call DestroyEffect(AddSpecialEffect("UI\\Feedback\\GoldCredit\\GoldCredit.mdl",x,y))

      endif

    set t=null
endfunction

This should cause less lag.
It should also take into account the players you want to recieve bounty only.
Just pop in the player number, it goes from 0 to 11
 
Level 3
Joined
Jun 27, 2008
Messages
34
heres the promblem i don't know how to add those thing to custom script i'm some what of a noob. so can u tell me how to copy that into my maps custom script code and how to pull up maps custom code? thanks for your time.
 
Level 6
Joined
Mar 20, 2008
Messages
208
make an ew trigger, click on edit, then convert to custom script, copy and paste where appropriate
 
Status
Not open for further replies.
Top