Mob Kill Counter (request)

More
2 weeks 4 days ago #9943 by Kay
Mob Kill Counter (request) was created 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
2 weeks 4 days ago #9944 by thomas
Replied by thomas on topic Mob Kill Counter (request)
There most certainly is.
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
2 weeks 2 days ago #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
2 weeks 3 hours ago #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.

Time to create page: 0.087 seconds