Guest User

Untitled

a guest
Feb 16th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. quest pet_system begin
  2. state start begin
  3. function get_pet_info(itemVnum)
  4. pet_info_map = {
  5. [53001] = {34033, "pet1", 0},
  6. [53002] = {34031, "pet2", 0},
  7. [53003] = {34003, "pet3", 0},
  8. [53005] = {34004, "pet4", 1},
  9. [53006] = {34009, "pet5", 1},
  10. [53007] = {34010, "pet6", 0},
  11. [53008] = {34011, "pet7", 0},
  12. [53009] = {34012, "pet8", 0},
  13. [53010] = {34008, "pet9", 0},
  14. [53011] = {34007, "pet10", 0},
  15. [53012] = {34005, "pet11", 0},
  16. [53013] = {34006, "pet12", 0},
  17. [53014] = {34031, "pet13", 0},
  18. [53016] = {34033, "pet14", 0},
  19. }
  20. itemVnum = tonumber(itemVnum)
  21. return pet_info_map[itemVnum]
  22. end
  23. function get_spawn_effect_file(idx)
  24. effect_table = {
  25. [0] = nil,
  26. [1] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\npc2_appear.mse",
  27. }
  28. return effect_table [idx]
  29. end
  30. when login with pc.getqf('summoned') > 0 begin
  31. pet.summon(pc.getqf('summoned_pet'), pc.getqf('pet_name'), false)
  32. end
  33. when 53001.use or 53002.use or 53003.use or 53005.use or 53006.use or 53007.use or 53008.use or 53009.use or 53010.use or 53011.use or 53012.use or 53013.use or 53014.use or 53016.use begin
  34. local pet_info = pet_system.get_pet_info(item.vnum)
  35. if null != pet_info then
  36. local mobVnum = pet_info[1]
  37. local petName = pet_info[2]
  38. local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[3])
  39. if true == pet.is_summon(mobVnum) then
  40. if spawn_effect_file_name != nil then
  41. pet.spawn_effect (mobVnum, spawn_effect_file_name)
  42. end
  43. pet.unsummon(mobVnum)
  44. else
  45. if pet.count_summoned() < 1 or pc.is_gm() then
  46. pet.summon(mobVnum, " ".. petName, false)
  47. pc.setqf('summoned_pet', mobVnum)
  48. pc.setqf('pet_name', petName)
  49. pc.getqf('summoned', 1)
  50. else
  51. syschat("Too much pets.")
  52. end
  53. if spawn_effect_file_name != nil then
  54. pet.spawn_effect(mobVnum, spawn_effect_file_name)
  55. end
  56. end
  57. end
  58. end
  59. end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment