Advertisement
Guest User

Spell_Teleport_Alle.d

a guest
Jul 25th, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 8.97 KB | None | 0 0
  1.  
  2. const int SPL_Cost_Teleport = 10;
  3.  
  4. func void B_PrintTeleportTooFarAway(var int level)
  5. {
  6.     if(level != CurrentLevel)
  7.     {
  8.         PrintScreen(PRINT_TeleportTooFarAway,-1,YPOS_LevelUp,FONT_ScreenSmall,2);
  9.     };
  10. };
  11.  
  12.  
  13. instance Spell_Teleport(C_Spell_Proto)
  14. {
  15.     time_per_mana = 0;
  16.     spellType = SPELL_NEUTRAL;
  17.     targetCollectAlgo = TARGET_COLLECT_CASTER;
  18.     canTurnDuringInvest = 0;
  19.     targetCollectRange = 0;
  20.     targetCollectAzi = 0;
  21.     targetCollectElev = 0;
  22. };
  23.  
  24.  
  25. func int Spell_Logic_PalTeleportSecret(var int manaInvested)
  26. {
  27.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  28.     {
  29.         return SPL_SENDCAST;
  30.     }
  31.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  32.     {
  33.         return SPL_SENDCAST;
  34.     };
  35.     return SPL_NEXTLEVEL;
  36. };
  37.  
  38. func void Spell_Cast_PalTeleportSecret()
  39. {
  40.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  41.     if(Npc_GetActiveSpellIsScroll(self))
  42.     {
  43.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  44.     }
  45.     else
  46.     {
  47.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  48.     };
  49.     AI_Teleport(self,"NW_PAL_SECRETCHAMBER");
  50.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  51. };
  52.  
  53. func int Spell_Logic_TeleportSeaport(var int manaInvested)
  54. {
  55.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  56.     {
  57.         return SPL_SENDCAST;
  58.     }
  59.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  60.     {
  61.         return SPL_SENDCAST;
  62.     };
  63.     return SPL_NEXTLEVEL;
  64. };
  65.  
  66. func void Spell_Cast_TeleportSeaport()
  67. {
  68.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  69.     if(Npc_GetActiveSpellIsScroll(self))
  70.     {
  71.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  72.     }
  73.     else
  74.     {
  75.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  76.     };
  77.     AI_Teleport(self,"HAFEN");
  78.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  79. };
  80.  
  81. func int Spell_Logic_TeleportMonastery(var int manaInvested)
  82. {
  83.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  84.     {
  85.         return SPL_SENDCAST;
  86.     }
  87.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  88.     {
  89.         return SPL_SENDCAST;
  90.     };
  91.     return SPL_NEXTLEVEL;
  92. };
  93.  
  94. func void Spell_Cast_TeleportMonastery()
  95. {
  96.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  97.     if(Npc_GetActiveSpellIsScroll(self))
  98.     {
  99.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  100.     }
  101.     else
  102.     {
  103.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  104.     };
  105.     AI_Teleport(self,"KLOSTER");
  106.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  107. };
  108.  
  109. func int Spell_Logic_TeleportFarm(var int manaInvested)
  110. {
  111.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  112.     {
  113.         return SPL_SENDCAST;
  114.     }
  115.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  116.     {
  117.         return SPL_SENDCAST;
  118.     };
  119.     return SPL_NEXTLEVEL;
  120. };
  121.  
  122. func void Spell_Cast_TeleportFarm()
  123. {
  124.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  125.     if(Npc_GetActiveSpellIsScroll(self))
  126.     {
  127.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  128.     }
  129.     else
  130.     {
  131.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  132.     };
  133.     AI_Teleport(self,"BIGFARM");
  134.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  135. };
  136.  
  137. func int Spell_Logic_TeleportXardas(var int manaInvested)
  138. {
  139.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  140.     {
  141.         return SPL_SENDCAST;
  142.     }
  143.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  144.     {
  145.         return SPL_SENDCAST;
  146.     };
  147.     return SPL_NEXTLEVEL;
  148. };
  149.  
  150. func void Spell_Cast_TeleportXardas()
  151. {
  152.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  153.     if(Npc_GetActiveSpellIsScroll(self))
  154.     {
  155.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  156.     }
  157.     else
  158.     {
  159.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  160.     };
  161.     AI_Teleport(self,"XARDAS");
  162.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  163. };
  164.  
  165. func int Spell_Logic_TeleportPassNW(var int manaInvested)
  166. {
  167.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  168.     {
  169.         return SPL_SENDCAST;
  170.     }
  171.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  172.     {
  173.         return SPL_SENDCAST;
  174.     };
  175.     return SPL_NEXTLEVEL;
  176. };
  177.  
  178. func void Spell_Cast_TeleportPassNW()
  179. {
  180.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  181.     if(Npc_GetActiveSpellIsScroll(self))
  182.     {
  183.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  184.     }
  185.     else
  186.     {
  187.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  188.     };
  189.     AI_Teleport(self,"LEVELCHANGE");
  190.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  191. };
  192.  
  193. func int Spell_Logic_TeleportPassOW(var int manaInvested)
  194. {
  195.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  196.     {
  197.         return SPL_SENDCAST;
  198.     }
  199.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  200.     {
  201.         return SPL_SENDCAST;
  202.     };
  203.     return SPL_NEXTLEVEL;
  204. };
  205.  
  206. func void Spell_Cast_TeleportPassOW()
  207. {
  208.     B_PrintTeleportTooFarAway(OldWorld_Zen);
  209.     if(Npc_GetActiveSpellIsScroll(self))
  210.     {
  211.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  212.     }
  213.     else
  214.     {
  215.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  216.     };
  217.     AI_Teleport(self,"SPAWN_MOLERAT02_SPAWN01");
  218.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  219. };
  220.  
  221. func int Spell_Logic_TeleportOC(var int manaInvested)
  222. {
  223.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  224.     {
  225.         return SPL_SENDCAST;
  226.     }
  227.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  228.     {
  229.         return SPL_SENDCAST;
  230.     };
  231.     return SPL_NEXTLEVEL;
  232. };
  233.  
  234. func void Spell_Cast_TeleportOC()
  235. {
  236.     B_PrintTeleportTooFarAway(OldWorld_Zen);
  237.     if(Npc_GetActiveSpellIsScroll(self))
  238.     {
  239.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  240.     }
  241.     else
  242.     {
  243.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  244.     };
  245.     AI_Teleport(self,"OC_MAGE_CENTER");
  246.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  247. };
  248.  
  249. func int Spell_Logic_TeleportOWDemonTower(var int manaInvested)
  250. {
  251.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  252.     {
  253.         return SPL_SENDCAST;
  254.     }
  255.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  256.     {
  257.         return SPL_SENDCAST;
  258.     };
  259.     return SPL_NEXTLEVEL;
  260. };
  261.  
  262. func void Spell_Cast_TeleportOWDemonTower()
  263. {
  264.     B_PrintTeleportTooFarAway(OldWorld_Zen);
  265.     if(Npc_GetActiveSpellIsScroll(self))
  266.     {
  267.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  268.     }
  269.     else
  270.     {
  271.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  272.     };
  273.     AI_Teleport(self,"DT_E3_03");
  274.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  275. };
  276.  
  277. func int Spell_Logic_TeleportTaverne(var int manaInvested)
  278. {
  279.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  280.     {
  281.         return SPL_SENDCAST;
  282.     }
  283.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  284.     {
  285.         return SPL_SENDCAST;
  286.     };
  287.     return SPL_NEXTLEVEL;
  288. };
  289.  
  290. func void Spell_Cast_TeleportTaverne()
  291. {
  292.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  293.     if(Npc_GetActiveSpellIsScroll(self))
  294.     {
  295.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  296.     }
  297.     else
  298.     {
  299.         self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  300.     };
  301.     AI_Teleport(self,"NW_TAVERNE_04");
  302.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  303. };
  304.  
  305. func int Spell_Logic_TeleportIsland(var int manaInvested)
  306.     {
  307.  
  308.     if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
  309.  
  310.     {
  311.  
  312.     return SPL_SENDCAST;
  313.  
  314.     }
  315.     else if(self.attribute[ATR_MANA] >= SPL_Cost_Teleport)
  316.     {
  317.  
  318.     return SPL_SENDCAST;
  319.  
  320.     };
  321.  
  322.     return SPL_NEXTLEVEL;
  323.     };
  324.  
  325. func void Spell_Cast_TeleportIsland()
  326.    
  327.     {
  328.     B_PrintTeleportTooFarAway(NEWWORLD_ZEN);
  329.  
  330.     if(Npc_GetActiveSpellIsScroll(self))
  331.     {
  332.  
  333.     self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  334.  
  335.     }
  336.     else
  337.     {
  338.  
  339.     self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Teleport;
  340.  
  341.     };
  342.  
  343.     AI_Teleport(self,"NW_ISLAND_CAMP");
  344.     AI_PlayAni(self,"T_HEASHOOT_2_STAND");
  345.  
  346.     };
  347.    
  348.    
  349.  
  350. func void Spell_Cast_Teleport()
  351. {
  352.     if(Npc_GetActiveSpell(self) == SPL_PalTeleportSecret)
  353.     {
  354.         Spell_Cast_PalTeleportSecret();
  355.     };
  356.     if(Npc_GetActiveSpell(self) == SPL_TeleportSeaport)
  357.     {
  358.         Spell_Cast_TeleportSeaport();
  359.     };
  360.     if(Npc_GetActiveSpell(self) == SPL_TeleportMonastery)
  361.     {
  362.         Spell_Cast_TeleportMonastery();
  363.     };
  364.     if(Npc_GetActiveSpell(self) == SPL_TeleportFarm)
  365.     {
  366.         Spell_Cast_TeleportFarm();
  367.     };
  368.     if(Npc_GetActiveSpell(self) == SPL_TeleportXardas)
  369.     {
  370.         Spell_Cast_TeleportXardas();
  371.     };
  372.     if(Npc_GetActiveSpell(self) == SPL_TeleportPassNW)
  373.     {
  374.         Spell_Cast_TeleportPassNW();
  375.     };
  376.     if(Npc_GetActiveSpell(self) == SPL_TeleportPassOW)
  377.     {
  378.         Spell_Cast_TeleportPassOW();
  379.     };
  380.     if(Npc_GetActiveSpell(self) == SPL_TeleportOC)
  381.     {
  382.         Spell_Cast_TeleportOC();
  383.     };
  384.     if(Npc_GetActiveSpell(self) == SPL_TeleportOWDemonTower)
  385.     {
  386.         Spell_Cast_TeleportOWDemonTower();
  387.     };
  388.     if(Npc_GetActiveSpell(self) == SPL_TeleportTaverne)
  389.     {
  390.         Spell_Cast_TeleportTaverne();
  391.     };
  392.     if(Npc_GetActiveSpell(self) == SPL_TeleportIsland)
  393.     {
  394.     Spell_Cast_TeleportIsland();
  395.     };
  396. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement