Guest User

Untitled

a guest
Apr 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.75 KB | None | 0 0
  1. //Zone script for Kalathor
  2. #include <stdlib.inc>
  3. #include <faldon.inc>
  4.  
  5. #define SCRIPTNAME "jstory38"
  6. #define STR1 6
  7. #define WEAPON "weapon"
  8. #define ARMOR "armor"
  9. #define SHIELD "shield"
  10. #define HELMET "helmet"
  11. #define GAUNTS "gauntlets"
  12. #define BOOTS "boots"
  13. #define RING1 "ring1"
  14. #define RING2 "ring2"
  15. #define CAPE "cape"
  16. #define GREAVES "greaves"
  17. #define QUIVER "quiver"
  18.  
  19. #define GSTRING 6
  20. #define NONE 0
  21. #define MIDDONE 25
  22. #define FALDKING 33
  23. #define FALDRDY 34
  24. #define FALDONE 35
  25. #define FALDTWO 36
  26. #define FALDTHREE 37
  27. #define FALDDONE 38
  28. #define FALDHERO 39
  29.  
  30. #define QUEST "#JuzaStoryQuest"
  31. #define KALA "^KALPART"
  32. #define KALID "^KALID"
  33. #define FID "^KFID"
  34.  
  35. #define BANCOUNT "^bancount"
  36. //MIDCOUNT can accept quest, MIDONE accepted quest, MIDTWO talked to the guy who has it, MIDTHREE has it, MIDDONE killed the TO, FISHBAR rewarded now to talk to the Fishburg Baron
  37. forward public zone_playerdeath(plrid, npcid, x, y, z, map);
  38. forward public zone_logoff(plrid, x, y, z, map);
  39. forward public zone_castspell(plrid, npcidtag, x, y, z, map, spellid);
  40.  
  41. //----------------------------------------------PLAYER ZONE DEATH
  42. public zone_playerdeath(plrid, npcid, x, y, z, map){
  43. shset(0, QUEST); //Quest Flag Tracking
  44. new q = gsGetFlag(plrid, 0);
  45. new i;
  46.  
  47. shset(0, "zone_playerdeath_no_penalty");
  48. gsSetFlag(0, 0, 1);
  49.  
  50. //Kill Kalathor
  51. shset(1, KALID);
  52. new mobid = gsGetFlag(0, 1);
  53. gsKillSprite(0, mobid);
  54. //Now reset flags
  55. shset(GSTRING, KALA);
  56. gsSetFlag(0, GSTRING, 1);
  57. shset(GSTRING, KALID);
  58. gsSetFlag(0, GSTRING, 0);
  59.  
  60. if(q == FALDTWO){
  61.   shset(GSTRING, KALA);
  62.   gsSetFlag(0, GSTRING, 1);
  63.   shset(GSTRING, KALID);
  64.   gsSetFlag(0, GSTRING, 0);
  65.   shset(0, FID);
  66.   gsSetFlag(0, 0, 0);
  67.   shset(1,"Kalathor has beat ");
  68.   shset(0, "name");
  69.   new name = gsGetSFlag(plrid, 0, 0);
  70.   shappendb(1, name);
  71.   shappends(1, " in a one on one duel! Faldon is still tormented by Kalathor and his minion!");
  72.   for( i = 0 ; i < 150 ; i++ ){
  73.     gsLocalMessage( i, 1, 3);
  74.   }
  75.   shset(0, "Kalathor laughs and says, ''Hahaha! You foolish mortal! You cannot defeat me!''");
  76.   gsLocalMessage(plrid, 0, 0);
  77. }
  78. else{
  79.   shset(0, "I AM A CHEATER!");
  80.   gsSayMessage(plrid, 0);
  81. }
  82. }
  83. //---------------------------------------------PLAYER ZONE LOGOFF gsKillSprite(0,PlayerID);
  84. public zone_logoff(plrid, x, y, z, map){
  85. //cleanup called when a player logs off in the zone to kill Kalathor and reset the flags associated with this quest
  86. shset(GSTRING, KALID);
  87. new kid = gsGetFlag(0, GSTRING);
  88. gsKillSprite(0, kid);
  89.  
  90. shset(GSTRING, KALA);
  91. gsSetFlag(0, GSTRING, 1);
  92. shset(GSTRING, KALID);
  93. gsSetFlag(0, GSTRING, 0);
  94. shset(0, FID);
  95. gsSetFlag(0, 0, 0);
  96. shset(0, "name");
  97. new name = gsGetSFlag(plrid, 0, 0);
  98. shappendb(1, name);
  99. shappends(1, " logged in the middle of the duel with Kalathor, What a coward!");
  100. new i;
  101. for( i = 0 ; i < 150 ; i++ ){
  102.   gsLocalMessage( i, 1, 3);
  103. }
  104. }
  105.  
  106. //---------------------------------------------PLAYER ZONE CASTSPELL
  107. public zone_castspell(plrid, npcidtag, x, y, z, map, spellid){
  108.  
  109. if(spellid == 37){
  110.   shset(0, "zone_spell_script");  shset(1, "jstory38"); gsSetSFlag(0, 0, 1);
  111.   shset(0, "zone_spell_function");  shset(1, "holyfunction"); gsSetSFlag(0, 0, 1);
  112. }
  113. }
  114.  
  115. public holyfunction(plrid, npcidtag, x, y, z, map, spellid) {
  116.   shset(GSTRING, BANCOUNT);
  117.   new curcount = gsGetFlag(plrid, GSTRING);
  118.   shset(GSTRING, KALID);
  119.   new kal = gsGetFlag(0, GSTRING);
  120.   if(curcount < 4 && npcidtag == kal){
  121.     curcount++
  122.     new ncount = curcount;
  123.     gsSetFlag(plrid, GSTRING, ncount);
  124.     shset(0, "You have weakened Kalathor with Banish! (Cast ");
  125.     shappendn(0, ncount);
  126.     shappends(0, " out of 4) ");
  127.     if(ncount == 4){
  128.       shappends(0, "You may now attack Kalathor!");
  129.     }
  130.     gsLocalMessage(plrid, 0, 0);
  131.   }
  132. }
Add Comment
Please, Sign In to add comment