Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Zone script for Kalathor
- #include <stdlib.inc>
- #include <faldon.inc>
- #define SCRIPTNAME "jstory38"
- #define STR1 6
- #define WEAPON "weapon"
- #define ARMOR "armor"
- #define SHIELD "shield"
- #define HELMET "helmet"
- #define GAUNTS "gauntlets"
- #define BOOTS "boots"
- #define RING1 "ring1"
- #define RING2 "ring2"
- #define CAPE "cape"
- #define GREAVES "greaves"
- #define QUIVER "quiver"
- #define GSTRING 6
- #define NONE 0
- #define MIDDONE 25
- #define FALDKING 33
- #define FALDRDY 34
- #define FALDONE 35
- #define FALDTWO 36
- #define FALDTHREE 37
- #define FALDDONE 38
- #define FALDHERO 39
- #define QUEST "#JuzaStoryQuest"
- #define KALA "^KALPART"
- #define KALID "^KALID"
- #define FID "^KFID"
- #define BANCOUNT "^bancount"
- //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
- forward public zone_playerdeath(plrid, npcid, x, y, z, map);
- forward public zone_logoff(plrid, x, y, z, map);
- forward public zone_castspell(plrid, npcidtag, x, y, z, map, spellid);
- //----------------------------------------------PLAYER ZONE DEATH
- public zone_playerdeath(plrid, npcid, x, y, z, map){
- shset(0, QUEST); //Quest Flag Tracking
- new q = gsGetFlag(plrid, 0);
- new i;
- shset(0, "zone_playerdeath_no_penalty");
- gsSetFlag(0, 0, 1);
- //Kill Kalathor
- shset(1, KALID);
- new mobid = gsGetFlag(0, 1);
- gsKillSprite(0, mobid);
- //Now reset flags
- shset(GSTRING, KALA);
- gsSetFlag(0, GSTRING, 1);
- shset(GSTRING, KALID);
- gsSetFlag(0, GSTRING, 0);
- if(q == FALDTWO){
- shset(GSTRING, KALA);
- gsSetFlag(0, GSTRING, 1);
- shset(GSTRING, KALID);
- gsSetFlag(0, GSTRING, 0);
- shset(0, FID);
- gsSetFlag(0, 0, 0);
- shset(1,"Kalathor has beat ");
- shset(0, "name");
- new name = gsGetSFlag(plrid, 0, 0);
- shappendb(1, name);
- shappends(1, " in a one on one duel! Faldon is still tormented by Kalathor and his minion!");
- for( i = 0 ; i < 150 ; i++ ){
- gsLocalMessage( i, 1, 3);
- }
- shset(0, "Kalathor laughs and says, ''Hahaha! You foolish mortal! You cannot defeat me!''");
- gsLocalMessage(plrid, 0, 0);
- }
- else{
- shset(0, "I AM A CHEATER!");
- gsSayMessage(plrid, 0);
- }
- }
- //---------------------------------------------PLAYER ZONE LOGOFF gsKillSprite(0,PlayerID);
- public zone_logoff(plrid, x, y, z, map){
- //cleanup called when a player logs off in the zone to kill Kalathor and reset the flags associated with this quest
- shset(GSTRING, KALID);
- new kid = gsGetFlag(0, GSTRING);
- gsKillSprite(0, kid);
- shset(GSTRING, KALA);
- gsSetFlag(0, GSTRING, 1);
- shset(GSTRING, KALID);
- gsSetFlag(0, GSTRING, 0);
- shset(0, FID);
- gsSetFlag(0, 0, 0);
- shset(0, "name");
- new name = gsGetSFlag(plrid, 0, 0);
- shappendb(1, name);
- shappends(1, " logged in the middle of the duel with Kalathor, What a coward!");
- new i;
- for( i = 0 ; i < 150 ; i++ ){
- gsLocalMessage( i, 1, 3);
- }
- }
- //---------------------------------------------PLAYER ZONE CASTSPELL
- public zone_castspell(plrid, npcidtag, x, y, z, map, spellid){
- if(spellid == 37){
- shset(0, "zone_spell_script"); shset(1, "jstory38"); gsSetSFlag(0, 0, 1);
- shset(0, "zone_spell_function"); shset(1, "holyfunction"); gsSetSFlag(0, 0, 1);
- }
- }
- public holyfunction(plrid, npcidtag, x, y, z, map, spellid) {
- shset(GSTRING, BANCOUNT);
- new curcount = gsGetFlag(plrid, GSTRING);
- shset(GSTRING, KALID);
- new kal = gsGetFlag(0, GSTRING);
- if(curcount < 4 && npcidtag == kal){
- curcount++
- new ncount = curcount;
- gsSetFlag(plrid, GSTRING, ncount);
- shset(0, "You have weakened Kalathor with Banish! (Cast ");
- shappendn(0, ncount);
- shappends(0, " out of 4) ");
- if(ncount == 4){
- shappends(0, "You may now attack Kalathor!");
- }
- gsLocalMessage(plrid, 0, 0);
- }
- }
Add Comment
Please, Sign In to add comment