Advertisement
Guest User

e_mascota

a guest
Jun 22nd, 2015
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. // ######################
  2. // ### (E) e_mascota ###
  3. // ######################
  4. // Evento que tienen todas las monturas o npcs domados.
  5. // Se quita en el PETDESERT y en el RELEASE.
  6. // Al resucitar o si se crea un item modificador de color para monturas, debe setear el oskin y el color, ambos.
  7. [EVENTS e_mascota]
  8. ON=@Click
  9. IF (<BONDED> == 1)
  10. IF ((<TAG0.LEAL_MUERTA> == 1) && (<FLAGS>&statf_dead))
  11. MESSAGE (Leal) (Muerto)
  12. ELSE
  13. MESSAGE @041 (Leal)
  14. ENDIF
  15. ENDIF
  16. RETURN 0
  17.  
  18. ON=@DClick
  19. IF (<IsMyPet>)
  20. TAG.AMO=<SRC>
  21. ENDIF
  22. RETURN 0
  23.  
  24. ON=@GetHit
  25. IF (<TAG0.LEAL_MUERTA> == 1)
  26. SRC.ACTION=-1
  27. RETURN 1
  28. ENDIF
  29. IF (<BONDED> == 1)
  30. IF (<IsMyPet>)
  31. HITS=<EVAL <HITS>+-<ARGN1>>
  32. RETURN 1
  33. ENDIF
  34. ENDIF
  35. RETURN 0
  36.  
  37. ON=@Hit
  38. IF (<TAG0.LEAL_MUERTA> == 1)
  39. RETURN 1
  40. ENDIF
  41. RETURN 0
  42.  
  43. ON=@SpellEffect
  44. IF (<TAG0.LEAL_MUERTA> == 1)
  45. IF ((<argn> == 59) && (<SRC.ISGM>))
  46. RETURN 0
  47. ENDIF
  48. ACTION=-1
  49. RETURN 1
  50. ENDIF
  51. IF (<BONDED> == 1)
  52. IF (<IsMyPet>)
  53. IF ((<argn> == 1) || (<argn> == 3) || (<argn> == 5) || (<argn> == 8) || (<argn> == 12) || (<argn> == 18) || (<argn> == 20) || (<argn> == 27) || (<argn> == 30) || (<argn> == 31) || (<argn> == 37) || (<argn> == 38) || (<argn> == 42) || (<argn> == 43) || (<argn> == 49) || (<argn> == 53) || (<argn> == 51) || (<argn> == 55) || (<argn> == 57) || (<argn> == 39) || (<argn> == 47))
  54. HITS=<EVAL <HITS>+-<ARGN1>>
  55. RETURN 1
  56. ENDIF
  57. ENDIF
  58. ENDIF
  59. RETURN 0
  60.  
  61. ON=@EnvironChange
  62. IF (<SRC.BONDED> == 1)
  63. SRC.FOOD=<SRC.MAXFOOD>
  64. ENDIF
  65. RETURN 0
  66.  
  67. ON=@PersonalSpace
  68. // Puede ser pisado siempre si la mascota es de un novato.
  69. IF (<MEMORYFINDTYPE.memory_ipet.LINK.ISEVENT.e_novato>)
  70. ARGN1=0
  71. ENDIF
  72. RETURN 0
  73.  
  74. ON=@ReceiveItem
  75. IF (<TAG0.LEAL_MUERTA> == 1)
  76. SRC.MESSAGE La mascota esta muerta.
  77. RETURN 1
  78. ENDIF
  79. RETURN 0
  80.  
  81. ON=@NPCActFight
  82. // Evita que los npcs mascotas de jugadores o invocados dañen a los novatos.
  83. IF ((<MEMORYFINDTYPE.memory_ipet.LINK.ISPLAYER>) || (<FINDID.i_rune_summon_creature>) || (<FLAGS>&statf_conjured))
  84. IF ((<SRC.ISPLAYER>) && (<SRC.ISEVENT.e_novato>))
  85. IF !(<SRC.ISEVENT.e_entrenamiento>)
  86. Attacker.<attacker.id <src>>.delete
  87. ACTION = 065
  88. FLAGS = <FLAGS> & ~statf_war
  89. RETURN 1
  90. ENDIF
  91. ENDIF
  92. ENDIF
  93. RETURN 0
  94.  
  95. ON=@HitTry
  96. // Evita que los npcs mascotas de jugadores o invocados dañen a los novatos.
  97. IF ((<MEMORYFINDTYPE.memory_ipet.LINK.ISPLAYER>) || (<FINDID.i_rune_summon_creature>) || (<FLAGS>&statf_conjured))
  98. IF ((<SRC.ISPLAYER>) && (<SRC.ISEVENT.e_novato>))
  99. IF !(<SRC.ISEVENT.e_entrenamiento>)
  100. Attacker.<attacker.id <src>>.delete
  101. ACTION = 065
  102. FLAGS = <FLAGS> & ~statf_war
  103. RETURN 1
  104. ENDIF
  105. ENDIF
  106. ENDIF
  107. RETURN 0
  108.  
  109. ON=@Resurrect
  110. // argn1 is the hitpoints value the char will have when resurrected (RW).
  111. // argo is the corpse (if any near) (R).
  112. // src is the resurrector.
  113. TAG.LEAL_MUERTA=
  114. CAN=<CAN>&~mt_ghost
  115. TIMERF 1,HOME
  116. HOMEDIST=12
  117. FLAGS=<FLAGS>&~statf_war
  118. FLAGS=<FLAGS>&~statf_poisoned
  119. SPELLEFFECT s_cure,1000
  120. KARMA=<TAG0.KARMA_MUERTE>
  121. TAG.KARMA_MUERTE=
  122. COLOR=<oskin>
  123. // IF (<TAG0.AMO.ISONLINE>
  124. // TRYSRC <owner> HEAR FOLLOW ME
  125. // ENDIF
  126. FINDID.i_memoria_borra_espiritu.REMOVE
  127. RETURN 0
  128.  
  129. ON=@Death
  130. IF (<BONDED>==1)
  131. TAG.LEAL_MUERTA=1
  132. COLOR=03c1 // Color de npc muerto.
  133.  
  134. // Eliminamos memorias de combate.
  135. MEMORYFINDTYPE.04.LINK=
  136. MEMORYFINDTYPE.08.LINK=
  137. MEMORYFINDTYPE.010.LINK=
  138. MEMORYFINDTYPE.020.LINK=
  139. MEMORYFINDTYPE.02000.LINK=
  140. ACTION=-1
  141. SRC.ACTION=-1
  142. FLAGS = <FLAGS> & ~statf_war
  143. FLAGS = <FLAGS> &~ statf_poisoned
  144. SPELLEFFECT s_cure,1000
  145.  
  146. // Le seteamos la memoria de mascota y su amo.
  147. SERV.NEWITEM=i_memory
  148. NEW.ATTR=attr_newbie
  149. NEW.MORE1=04
  150. NEW.MORE2=<SERV.TIME>
  151. NEW.MOREP=<SRC.P>
  152. NEW.COLOR=memory_ipet
  153. NEW.TIMER=-1
  154. NEW.LINK=<TAG.AMO>
  155. NEW.LAYER=layer_special
  156. NEW.CONT=<UID>
  157. // IF (<TAG0.AMO.ISONLINE>
  158. // TRYSRC <owner> HEAR DROP
  159. // ENDIF
  160.  
  161. // Puede atravesar puertas.
  162. CAN |= mt_ghost
  163.  
  164. // Guardamos el KARMA y la hacemos pitu.
  165. TAG.KARMA_MUERTE=<KARMA>
  166. KARMA=0
  167.  
  168. // Hasta 12 casillas de donde muere.
  169. TIMERF 1,HOME
  170. HOMEDIST=12
  171.  
  172. // Metemos timer de borrado de 2 dias.
  173. SERV.NEWITEM=i_memoria_borra_espiritu
  174. NEW.EQUIP
  175.  
  176. // A seguir al amo.
  177. TIMERF 3,ACTION=064
  178. ENDIF
  179. RETURN 0
  180.  
  181. ON=@DeathCorpse
  182. IF (<SRC.BONDED>==1)
  183. ARGO.REMOVE
  184. ENDIF
  185.  
  186. [ITEMDEF i_memoria_borra_espiritu]
  187. ID=i_rune_paralyze
  188. NAME=[Borrado Leal DEAD]
  189. TYPE=t_eq_script
  190. LAYER=layer_special
  191.  
  192. ON=@CREATE
  193. COLOR=33
  194. TIMER=172800 // Para que borre el npc a los 2 dias.
  195.  
  196. ON=@TIMER
  197. CONT.BONDED=0
  198. REMOVE
  199. RETURN 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement