PabloEduardo

clonalmeja

Feb 27th, 2022 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.20 KB | None | 0 0
  1. command /clonalmeja:
  2. trigger:
  3. set {_nick22} to player
  4. set {_duracion22} to 30
  5. set {_cantidad22} to 4
  6. set {_cantidad11} to 1
  7. loop {_cantidad22} times:
  8. clonalmeja({_nick22}, {_duracion22}, {_cantidad11})
  9. add 1 to {_cantidad11}
  10. if {_cantidad11} = 5:
  11. set {_cantidad11} to 1
  12. clear {locposs.%player%1}
  13. clear {locposs.%player%2}
  14. clear {locposs.%player%3}
  15. clear {locposs.%player%4}
  16.  
  17. function clonalmeja(nombreclon: player, duracion: number, cantidad: number):
  18. set {_npcsombra} to a npc with name "%{_nombreclon}% " and entity type "PLAYER"
  19.  
  20. if {_cantidad} = 1:
  21. if {locposs.%{_nombreclon}%1} is not set:
  22. set {locposs.%{_nombreclon}%1} to 1
  23. set {_loc} to the location 1 meter upwards and {locposs.%{_nombreclon}%1} meter forwards {_nombreclon}
  24. add 1 to {locposs.%{_nombreclon}%1}
  25. spawn npc {_npcsombra} at {_loc}
  26. if {_cantidad} = 2:
  27. if {locposs.%{_nombreclon}%2} is not set:
  28. set {locposs.%{_nombreclon}%2} to 1
  29. set {_loc} to the location 1 meter upwards and {locposs.%{_nombreclon}%2} meter behind {_nombreclon}
  30. add 1 to {locposs.%{_nombreclon}%2}
  31. spawn npc {_npcsombra} at {_loc}
  32. if {_cantidad} = 3:
  33. if {locposs.%{_nombreclon}%3} is not set:
  34. set {locposs.%{_nombreclon}%3} to 1
  35. set {_loc} to the location 1 meter upwards and {locposs.%{_nombreclon}%3} meter left {_nombreclon}
  36. add 1 to {locposs.%{_nombreclon}%3}
  37. spawn npc {_npcsombra} at {_loc}
  38. if {_cantidad} = 4:
  39. if {locposs.%{_nombreclon}%4} is not set:
  40. set {locposs.%{_nombreclon}%4} to 1
  41. set {_loc} to the location 1 meter upwards and {locposs.%{_nombreclon}%4} meter right {_nombreclon}
  42. add 1 to {locposs.%{_nombreclon}%4}
  43. spawn npc {_npcsombra} at {_loc}
  44.  
  45. set {_npcid} to id of npc {_npcsombra}
  46. add {_npcid} to {clonalmeja.%{_nombreclon}%::*}
  47. add {_npcsombra} to {clonalmejaatk.%{_nombreclon}%::*}
  48. add {_npcid} to {clonknock::*}
  49. add {_npcsombra} to {clondmg::*}
  50. set {_nick} to "%{_nombreclon}%"
  51. set {_nick2} to lowercase({_nick})
  52. change citizen {_npcid} skin to "diamond4life"
  53. set the protected state of npc {_npcsombra} to true
  54. set {clonalmejaid.%{_npcid}%} to {_npcsombra}
  55. set {alive.%{_npcid}%} to true
  56. make console execute command "/npc sel %{_npcid}%"
  57. make console execute command "/npc speed 4"
  58.  
  59. cercano2(citizen {_npcid}, 10, {_npcid}, {_nombreclon})
  60.  
  61. wait 5 minutes
  62.  
  63. make console execute command "/npc remove %{_npcid}%"
  64. remove {_npcid} from {clonalmeja.%{_nombreclon}%::*}
  65. clear {clonalmejaatk.%{_nombreclon}%::*}
  66. remove {_npcid} from {clonknock::*}
  67. set {alive.%{_npcid}%} to false
  68. clear {alive.%{_npcid}%}
  69.  
  70.  
  71. function cercano2(obj: object, rad: number, npcsid: object, nick: player):
  72. while {alive.%{_npcsid}%} is true:
  73.  
  74. if {cmcla.%{_nick}%} = "seguir":
  75. make npc {clonalmejaid.%{_npcsid}%} to attack {_nick} with aggressive state false
  76.  
  77. if {cmcla.%{_nick}%} = "atk":
  78. make npc {clonalmejaid.%{_npcsid}%} to attack {targetcla.%{_nick}%} with aggressive state true
  79.  
  80. if {cmcla.%{_nick}%} = "quiet":
  81. make npc {clonalmejaid.%{_npcsid}%} to attack {_rad} with aggressive state true
  82.  
  83. wait 10 ticks
  84.  
  85. on death:
  86. if attacker is a citizen:
  87. set {_nickatk} to "%attacker%"
  88. set {_nickdmg} to nickfix({_nickatk})
  89. if {targetcla.%{_nickdmg}%} = victim:
  90. set {cmcla.%{_nickdmg}%} to "seguir"
  91. if victim is a citizen:
  92. set {_npcid} to citizen id of victim
  93. set {_nickk} to "%victim%"
  94. set {_nickk2} to "%attacker%"
  95. set {_nicktarget} to nickfix({_nickk})
  96. loop {clonalmeja.%{_nicktarget}%::*}:
  97. if loop-value is {_npcid}:
  98. if {_nicktarget} = {_nickk2}:
  99. cancel event
  100. else:
  101. make console execute command "/npc remove %{_npcid}%"
  102. remove {_npcid} from {clonalmeja.%victim%::*}
  103. remove {_npcid} from {clonknock::*}
  104. stop loop
  105.  
  106. on left click:
  107. if name of player's tool is "&b&LClones Slime":
  108. if player is sneaking:
  109. set {cmcla.%player%} to "quiet"
  110. clear {targetcla.%player%}
  111. else:
  112. set {targetcla.%player%} to target entity of player
  113. set {cmcla.%player%} to "atk"
  114.  
  115. on Right click:
  116. if name of player's tool is "&b&LClones Slime":
  117. set {cmcla.%player%} to "seguir"
  118. clear {targetcla.%player%}
  119.  
  120.  
  121. command /libroslime:
  122. trigger:
  123. give player an enchanted book with name "&b&LClones Slime"
  124.  
  125. on damage:
  126. if attacker is a citizen:
  127. set {_npcid} to citizen id of attacker
  128. set {_nickatk} to "%attacker%"
  129. set {_nickdmg} to nickfix({_nickatk})
  130. loop {clonalmeja.%{_nickdmg}%::*}:
  131. if loop-value is {_npcid}:
  132. set damage to 4
Add Comment
Please, Sign In to add comment