Welcome to the Builder Academy

Question Mob Kill Counter (request)

More
03 Oct 2021 08:21 #9943 by Kay
I am trying to come up with a shorter (death) trigger that counts the number of times a player has killed an mob. I've been using the one below, however the one I am currently trying to make requires the player to go up to 100 kills. Now I could keep brute forcing the one I have below until it counts to 100 but I'm certain that there's an easier way to do this.

set demon_kills
if (%actor.varexists(demon_kills)%)
  if (%actor.demon_kills% == 0)
    eval demon_kills 1
    remote demon_kills %actor.id%
    %send% %actor% You have killed 1 Demon in total.
  elseif (%actor.demon_kills% == 1)
    eval demon_kills 2
    remote demon_kills %actor.id%
    %send% %actor% You have killed 2 Demons in total.
  elseif (%actor.demon_kills% == 2)
    eval demon_kills 3
    remote demon_kills %actor.id%
    %send% %actor% You have killed 3 Demons in total.
  elseif (%actor.demon_kills% == 3)
    eval demon_kills 4
    remote demon_kills %actor.id%
    %send% %actor% You have killed 4 Demons in total.
  elseif (%actor.demon_kills% == 4)
    eval demon_kills 5
    remote demon_kills %actor.id%
    %send% %actor% You have killed 5 Demons in total.
  elseif (%actor.demon_kills% == 5)
    eval demon_kills 6
    remote demon_kills %actor.id%
    %send% %actor% You have killed 6 Demons in total.
  elseif (%actor.demon_kills% == 6)
    eval demon_kills 7
    remote demon_kills %actor.id%
    %send% %actor% You have killed 7 Demons in total.
  elseif (%actor.demon_kills% == 7)
    eval demon_kills 8
    remote demon_kills %actor.id%
    %send% %actor% You have killed 8 Demons in total.
  elseif (%actor.demon_kills% == 8)
    eval demon_kills 9
    remote demon_kills %actor.id%
    %send% %actor% You have killed 9 Demons in total.
  elseif (%actor.demon_kills% == 9)
    eval demon_kills 10
    remote demon_kills %actor.id%
    %send% %actor% You have killed 10 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 10)
    eval demon_kills 11
    remote demon_kills %actor.id%
    %send% %actor% You have killed 11 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 11)
    eval demon_kills 12
    remote demon_kills %actor.id%
    %send% %actor% You have killed 12 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 12)
    eval demon_kills 13
    remote demon_kills %actor.id%
    %send% %actor% You have killed 13 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 13)
    eval demon_kills 14
    remote demon_kills %actor.id%
    %send% %actor% You have killed 14 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 14)
    eval demon_kills 15
    remote demon_kills %actor.id%
    %send% %actor% You have killed 15 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 15)
    eval demon_kills 16
    remote demon_kills %actor.id%
    %send% %actor% You have killed 16 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 16)
    eval demon_kills 17
    remote demon_kills %actor.id%
    %send% %actor% You have killed 17 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 17)
    eval demon_kills 18
    remote demon_kills %actor.id%
    %send% %actor% You have killed 18 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 18)
    eval demon_kills 19
    remote demon_kills %actor.id%
    %send% %actor% You have killed 19 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 19)
    eval demon_kills 20
    remote demon_kills %actor.id%
    %send% %actor% You have killed 20 Demons in total.
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == 20)
    eval demon_kills Special
    remote demon_kills %actor.id%
    %send% %actor% You have killed numerous Demons...
    %send% %actor% You have killed enough Demons.
  elseif (%actor.demon_kills% == Special)
    %send% %actor% You have killed numerous Demons...
    %send% %actor% You have killed enough Demons.
  end
end


 

Please Log in or Create an account to join the conversation.

More
03 Oct 2021 11:22 #9944 by thomas
Replied by thomas on topic Mob Kill Counter (request)
There most certainly is.
Code:
set demon_kills if (%actor.varexists(demon_kills)%)   if (%actor.demon_kills% == Special)     %send% %actor% You have killed extreme amounts of demons!     halt   end     eval demon_kills %actor.demon_kills%+1 else   set demon_kills 1 end %send% %actor% You have killed %demon_kills% Demon in total. if (%demon_kills% > 100)   set demon_kills Special end remote demon_kills %actor.id%
The following user(s) said Thank You: Kay

Please Log in or Create an account to join the conversation.

More
05 Oct 2021 22:45 #9945 by Kay
Replied by Kay on topic Mob Kill Counter (request)
I'm struggling to get this to work because I actually need two triggers. One trigger that gives the quest/sets the variable that is given by a different mob (%demon_kills%) and another that is a death trigger that is actually on the mobs that must be killed.

Any chance you could please help, please

Please Log in or Create an account to join the conversation.

More
07 Oct 2021 21:04 #9948 by thomas
Replied by thomas on topic Mob Kill Counter (request)
The example I gave should be expandable to that use case, I think.

Please Log in or Create an account to join the conversation.

More
25 Jun 2022 00:58 #10092 by aegon
Replied by aegon on topic Mob Kill Counter (request)
so one of the things i wanted to provide the userbase was in-game badge questing - ala most MMOs, like, for example, Wizards101. you spend a bunch of time in an area farming for an obscure drop and you pile up mob victories. adding a badge layer for tiered victories just seems like a neat way to reward persistence.

here are two trigs that i use to simulate this for a corpse retrieval type quest.

first, the quest issuer provides clues to the quest. i throw languages at the player, so they need to have a translation tome somewhere on the cha for them to get the english version:

Name: 'kasrazas quest', VNum: [35108], RNum: [ 759]
Trigger Intended Assignment: Mobiles
Trigger Type: Greet , Numeric Arg: 100, Arg list: None
Commands:
*
* 0522 Aegon 350 Ice Fortress
*
* original weeden portmaster speech block code transcoding AP
*
if %actor.is_pc%
if !%actor.has_item(35102)%
wait 8 sec
%echo% The necromancer looks up from the great book spread on his podium, slowly, as if expecting you.
wait 8 sec
%echo% %actor.name%," he says, in a low growl, "Ak-ah nguh-h bek-ti ha-ibn, ag ah il timor fardung er ar."
wait 8 sec
%echo% Closing his Necronomicon, he locks the leather hasp and carefully skirts the corpse spread on his ice slab.
wait 8 sec
%echo% Stopping short of your party, he pauses and says, ""Ul-trant kaz dar bandesht fa hol ar tantan... Yad-nar-ag ah il timor ..."
wait 8 sec
%echo% He unfurls a wing and motions behind him, to the corpse rotting there.
wait 8 sec
%echo% "Ack-ar bandesht fa hol ar tantan, %actor.name%. Orag nar nar penti agh il da ag ti wellat-ah-ag-ur ..."
wait 8 sec
%echo% He selects another book, another dark talisman. "Senc-ur gash-tan ke-kenquent uhsh par Tinkewu..."
wait 8 sec
%echo% He moves away, already lost in an incantation, a conjuring, a delving into the profane and unspeakable.
wait 8 sec
%echo% Finally, he says, "Denk-ah-ughti ha irl."
wait 30 sec
else
wait 8 sec
%echo% The necromancer looks up from the great book spread on his podium, slowly, as if expecting you.
wait 8 sec
%echo% %actor.name%," he says, in low growl, "My spies have searched the realms for one such as you."
wait 8 sec
%echo% Closing his Necronomicon, he locks the leather hasp and carefully skirts the corpse spread on his ice slab.
wait 8 sec
%echo% Stopping short of your party, he pauses and says, "I require the bodies of the greatest dragons... for this magic..."
wait 8 sec
%echo% He unfurls a wing and motions behind him, to the corpse rotting there.
wait 8 sec
%echo% "As many as you can bring me, %actor.name%. My magic is growing, my skill improving..."
wait 8 sec
%echo% He selects another book, another dark talisman. "Do this, and I shall reward you in kind..."
wait 8 sec
%echo% He moves away, already lost in an incantation, a conjuring, a delving into the profane and unspeakable.
wait 8 sec
%echo% Finally, he says, "Now leave me."
wait 30 sec
end
end

then the reward trigger:

Name: 'dragon resurrected', VNum: [35019], RNum: [ 717]
Trigger Intended Assignment: Rooms
Trigger Type: Drop , Numeric Arg: 100, Arg list: None
Commands:
*
* 052822 Aegon 350 Ice Fortress
*
if %findmob.35017(35002)% = 1
context %actor.id%
* %echo% name: %object.name% object.shortdesc %object.shortdesc%
* set corpse_check 'dragon 'dracolich
* if %corpse_check.contains(%object.shortdesc%)% && %object.name% /= corpse
if (%object.shortdesc% /= slave || %object.shortdesc% /= dracolich) && %object.name% /= corpse
if %findmob.35017(35089)% = 0
wait 1 sec
%echo% Kasraza makes a sweeping gesture and the corpse is resurrected!
%echo% Behold Kasraza's mighty ice dracolich!
%load% mob 35089
else
wait 1 sec
%echo% The mighty zombie dracolich roars in pain as Kasraza attempts to resurrect the corpse.
end
if %actor.varexists(kasraza_dragons)%
eval kasraza_dragons %actor.kasraza_dragons% + 1
else
set kasraza_dragons 1
end
global kasraza_dragons
* %send% %actor% %actor.name%, you have provided %kasraza_dragons% dragon corpses to Kasraza the Master Necromancer.
remote kasraza_dragons %actor.id%
switch %kasraza_dragons%
case 1
%send% %actor% %actor.name%, you have unlocked the Zombie DragonHunter Badge!
break
case 50
%send% %actor% %actor.name%, you have unlocked the Zombie DragonMaster Badge!
* add reward here
break
case 100
%send% %actor% %actor.name%, you have unlocked the Zombie DragonLord Badge!
* add reward here
break
default
if %kasaraza_dragons% < 50
%send% %actor% %actor.name%, Zombie DragonHunter, you have achieved %kasraza_dragons% of 50 dragon corpses toward your next badge.
else if %kasaraza_dragons% < 100
%send% %actor% %actor.name%, Zombie DragonMaster, you have achieved %kasraza_dragons% of 100 dragon corpses toward your next badge.
end
break
done
else
%echo% Kasraza shakes his head, indifferent to your offering.
halt
end
else
return 0
end

i have a shopkeeper that will display a player's current quest badge status.

as they attain quest milestones, they can be rewarded with new items, assembly parts, quest tokens, gold and/or xp.

badges and badge tiers add dimensionality to the usual farm slog.

enjoy!

Please Log in or Create an account to join the conversation.

More
06 Jul 2022 03:47 #10101 by Parnassus
I noticed the language thing in the other trigger you posted. That's very cool!

Please Log in or Create an account to join the conversation.

Time to create page: 0.219 seconds