Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. quest pet_system begin
  2. state start begin
  3. function get_pet_info(itemVnum)
  4. pet_info_map = {
  5. -- [ITEM VNUM] MOB_VNUM, DEFAULT NAME
  6. [53001] = { 34001, gameforge.pet_system._010_say ,0},
  7. [53002] = { 34002, gameforge.pet_system._020_say ,0},
  8. [53003] = { 34003, gameforge.pet_system._040_say ,0},
  9. [53005] = { 34004, gameforge.pet_system._050_say, 1},
  10. [53006] = { 34009, gameforge.pet_system._050_say, 1},
  11. [53010] = { 34008, gameforge.pet_system._060_say, 0},
  12. [53011] = { 34007, gameforge.pet_system._070_say, 0},
  13. [53012] = { 34005, gameforge.pet_system._080_say, 0},
  14. [53013] = { 34006, gameforge.pet_system._090_say, 0},
  15. [53007] = { 34010, gameforge.pet_system._100_say, 0},
  16. [53008] = { 34011, gameforge.pet_system._110_say, 0},
  17. [53009] = { 34012, gameforge.pet_system._120_say, 0},
  18. [38200] = { 34006, gameforge.pet_system._090_say, 0},
  19. [38201] = { 34006, gameforge.pet_system._090_say, 0},
  20. [53014] = { 34013, gameforge.pet_system._130_say, 0},
  21. [53015] = { 34014, gameforge.pet_system._140_say, 0},
  22. [53016] = { 34015, gameforge.pet_system._150_say, 0},
  23. [53017] = { 34016, gameforge.pet_system._160_say, 0},
  24. [53018] = { 34020, gameforge.pet_system._170_say, 0},
  25. [53019] = { 34019, gameforge.pet_system._180_say, 0},
  26. [53020] = { 34017, gameforge.pet_system._190_say, 0},
  27. [53021] = { 34018, gameforge.pet_system._200_say, 0},
  28. [53022] = { 34021, gameforge.pet_system._200_say, 0},
  29. }
  30.  
  31. itemVnum = tonumber(itemVnum)
  32.  
  33. return pet_info_map[itemVnum]
  34. end
  35. function get_spawn_effect_file(idx)
  36. effect_table = {
  37. [0] = nil,
  38. [1] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\npc2_appear.mse",
  39. }
  40. return effect_table [idx]
  41. end
  42. when 38200.use or 38201.use or 53018.use or 53019.use or 53020.use or 53021.use or 53022.use or 53007.use or 53013.use or 53012.use or 53011.use or 53010.use or 53006.use or 53005.use or 53002.use or 53001.use or 53003.use or 53008.use or 53009.use or
  43. 53014.use or 53015.use or 53016.use or 53017.use begin
  44. local pet_info = pet_system.get_pet_info(item.vnum)
  45.  
  46. if null != pet_info then
  47.  
  48. local mobVnum = pet_info[1]
  49. local petName = pet_info[2]
  50. local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[3])
  51.  
  52. if true == pet.is_summon(mobVnum) then
  53. if spawn_effect_file_name != nil then
  54. pet.spawn_effect (mobVnum, spawn_effect_file_name)
  55. end
  56. pet.unsummon(mobVnum)
  57. else
  58. if pet.count_summoned() < 1 then
  59. pet.summon(mobVnum, petName, false)
  60. else
  61. syschat(gameforge.pet_system._030_chat)
  62. end
  63. if spawn_effect_file_name != nil then
  64. pet.spawn_effect (mobVnum, spawn_effect_file_name)
  65. end
  66. end -- if pet.is_summon
  67. end -- if null != pet_info
  68. end -- when
  69. end -- state
  70. end -- quest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement