//NPC Quests //Version 3.0 //Now allows you to choose how much info the guard tells you //Allows sextant or coordinate positioning as well now. //Configuration is done on line 60 //Thanks to GM Kelrinio for the idea and code to use //sextant coordinates. //Scripted by Rudenid //This is how I want this to work: //You are free to use this script... //So long as you leave the header intact //NPC ideas for each difficulty bracket are welcome. //Email me at metasquares@metasquares.com if you have a comment/etc. //Together we can make this script even better! [SPEECH guardquest] ON=*tasks* SPEECHCOLOR=0481 IF () SAYU is currently dealing with a for me . ELSE SAYU No one is performing any tasks for me at the moment... ENDIF ON=*help* SPEECHCOLOR=0481 SAYU If ye wish to perform a task for me, say "I wish to perform a task for thee" SAYU If ye wish to accept a task ye have heard me describe, say "I shall undertake this task" SAYU If ye wish to resign from a task ye have already begun, say "I resign from performing thine task" SAYU Say "tasks" to me if ye wish to know who is doing what for me... ON=*quest* ON=task SPEECHCOLOR=0481 SAY If ye wish to perform a task for me, please say "I wish to perform a task for thee" ON=I wish to perform a task for thee /////////////////////////////////////////// //Here's where you do your configuration!// // // //Values for VAR.NPCINFORMATION: // // // // 0 - Show no information. Confusing. // // 1 - Show region name. // // 2 - Show relativity to another region.// // 4 - Show sextant coordinates. // // 8 - Show position coordinates // // // // Combinations can be made by logical OR// // Very much like flags. // /////////////////////////////////////////// //By default, it will show region, relativity, and sextant coords. VAR.NPCINFORMATION=7 IF (&statf_conjured) SPEECHCOLOR=0481 SAYU I am too busy to leave my matters in the hands of others. RETURN 1 ENDIF IF () IF ( != ) SPEECHCOLOR=0fd DORAND 3 SAYU I am sorry, , but is already performing a task for me. SAYU I apologize, , but is aiding me with my problems right now. SAYU Forgive me, , but is giving me all the aid I require at the moment. SPEECHCOLOR=0481 ENDDO RETURN 1 ELSE SPEECHCOLOR=01eb SAYU Ah, , thou hast returned... if ye wish to resign from performing thine current task, just say "I resign from performing thine task" SPEECHCOLOR=0481 RETURN 1 ENDIF ELSE TAG.QUESTDIFFICULTY= + + > TAG.QUESTDIFFICULTY= / 3> TAG.QUESTDIFFICULTY= + / 60>> TAG.OLDPLACENAME= TAG.OLDPLACEP= TAG.OLDNPCNAME= TAG.OLDNPCID= VAR.OLDACT= SRC.NEWNPC c_man_invisible SRC.ACT.NAME=" " SRC.ACT.npcrandvalidlocation TAG.PLACEP= IF (> & 8) TAG.PLACECOORDS=It has last been seen near . ENDIF IF (> & 4) //The following code was by Kelorino... or whoever he got it from TAG.PLACEPXSEXTANT= TAG.PLACEPYSEXTANT= IF (0>=1323)&&(0>=1624) VAR.POSy=-(1624))>*(87882) VAR.POSx=-(1323))>*(70310) TAG.PLACESEXTANT=/1000000)>o'S , /1000000)>o'E ENDIF //////////////////////////////////////////////////////////////////////////////////// IF (0>=1323)&&(0<1624) VAR.POSy=)>*(87882) VAR.POSx=-(1323))>*(70310) TAG.PLACESEXTANT=/1000000)>o'N , /1000000)>o'E ENDIF ///////////////////////////////////////////////////////////////////////////////// IF (0<1323)&&(0>=1624) VAR.POSy=-(1624))>*(87882) VAR.POSx=)>*(70310) TAG.PLACESEXTANT=/1000000)>o'S , /1000000)>o'W ENDIF ////////////////////////////////////////////////////////////////////////////////// IF (<1323)&&(<1624) VAR.POSy=)>*(87882) VAR.POSx=)>*(70310) TAG.PLACESEXTANT=/1000000)>o'N , /1000000)>o'W ENDIF TAG.PLACEPXSEXTANT= TAG.PLACEPYSEXTANT= //End third party code TAG.PLACESEXTANT=It was last seen at . ENDIF IF (> & 2) SRC.ACT.nearestregion TAG.PLACEREGIONNEAR=. ENDIF IF (> & 1) TAG.PLACEREGIONNAME=in . ENDIF TAG.PLACENAME= TAG.PLACEREGIONNAME= TAG.PLACEREGIONNEAR= TAG.PLACESEXTANT= TAG.PLACECOORDS= SRC.ACT.REMOVE SRC.ACT=> VAR.OLDACT= IF (> < 200) DORAND 10 BEGIN TAG.NPCNAME=Troll TAG.NPCID=c_troll END BEGIN TAG.NPCNAME=Ettin TAG.NPCID=c_ettin END BEGIN TAG.NPCNAME=Orc Captain TAG.NPCID=c_m_orc_captain END BEGIN TAG.NPCNAME=Ratman TAG.NPCID=c_ratman END BEGIN TAG.NPCNAME=Liche TAG.NPCID=c_liche END BEGIN TAG.NPCNAME=Evil Mage TAG.NPCID=c_h_evilmage END BEGIN TAG.NPCNAME=Earth Elemental TAG.NPCID=c_elem_earth END BEGIN TAG.NPCNAME=Frost Elf Archer TAG.NPCID=c_h_frostelf_archer END BEGIN TAG.NPCNAME=Ghost TAG.NPCID=c_m_ghost END BEGIN TAG.NPCNAME=Gazer TAG.NPCID=c_gazer END ENDDO ELSEIF (> < 250) DORAND 10 BEGIN TAG.NPCNAME=Wisp TAG.NPCID=c_wisp_brown END BEGIN TAG.NPCNAME=Dread Lord TAG.NPCID=c_h_dreadlord END BEGIN TAG.NPCNAME=Wisp TAG.NPCID=c_wisp_gray END BEGIN TAG.NPCNAME=Snow Elemental TAG.NPCID=c_m_elem_snow END BEGIN TAG.NPCNAME=Liche Lord TAG.NPCID=c_m_liche_lord END BEGIN TAG.NPCNAME=Mummy TAG.NPCID=c_m_mummy END BEGIN TAG.NPCNAME=Evil Ranger TAG.NPCID=c_h_ranger_evil END BEGIN TAG.NPCNAME=Frost Elf Chieftain TAG.NPCID=c_h_frostelf_chief END BEGIN TAG.NPCNAME=Daemon TAG.NPCID=c_daemon END BEGIN TAG.NPCNAME=Skeleton Knight TAG.NPCID=c_m_skeleton_knight END ENDDO ELSEIF (> < 325) DORAND 10 BEGIN TAG.NPCNAME=Cyclops TAG.NPCID=c_cyclops END BEGIN TAG.NPCNAME=Ogre Lord TAG.NPCID=c_m_ogre_lord END BEGIN TAG.NPCNAME=Dread Lord Captain TAG.NPCID=c_h_dreadlord_captain END BEGIN TAG.NPCNAME=Blood Elemental TAG.NPCID=c_m_elem_blood END BEGIN TAG.NPCNAME=Daemon Knight TAG.NPCID=c_daemon_w_sword END BEGIN TAG.NPCNAME=Poison Elemental TAG.NPCID=c_m_elem_poison END BEGIN TAG.NPCNAME=Red Drake TAG.NPCID=c_dragon_small_red END BEGIN TAG.NPCNAME=Kraken TAG.NPCID=c_m_kraken END BEGIN TAG.NPCNAME=Nightmare TAG.NPCID=c_m_nightmare END BEGIN TAG.NPCNAME=Wyvern TAG.NPCID=c_m_wyvern END ENDDO ELSE DORAND 10 BEGIN TAG.NPCNAME=Titan TAG.NPCID=c_titan END BEGIN TAG.NPCNAME=Ogre Lord TAG.NPCID=c_m_ogre_lord END BEGIN TAG.NPCNAME=Necromancer TAG.NPCID=c_h_necromancer_f END BEGIN TAG.NPCNAME=Wisp TAG.NPCID=c_wisp_dark END BEGIN TAG.NPCNAME=Balron TAG.NPCID=c_m_balron END BEGIN TAG.NPCNAME=Shadow Dragon TAG.NPCID=c_m_dragon_crystal END BEGIN TAG.NPCNAME=Evil Summoner TAG.NPCID=c_h_evilsummoner END BEGIN TAG.NPCNAME=Kraken TAG.NPCID=c_m_kraken END BEGIN TAG.NPCNAME=Wyrm TAG.NPCID=c_m_dragon_wyrm END BEGIN TAG.NPCNAME=Phoenix TAG.NPCID=c_m_phoenix END ENDDO ENDIF IF (>==) TAG.NPCNAME= TAG.NPCID= TAG.PLACENAME= TAG.PLACEP= ENDIF TAG.PLAYERASKING= SPEECHCOLOR=01d4 DORAND 3 SAYU I am having a bit of trouble with a . Canst thou get rid of it for me? Reply "I shall undertake this task" if ye wish to accept this task. SAYU A has been causing trouble . Do ye wish to undertake the task of slaying it? Reply "I shall undertake this task" if thou'rt interested. SAYU There have been reports of a causing problems . Canst thou take care of it for me? Reply "I shall undertake this task" if ye shall. ENDDO SPEECHCOLOR=0481 TAG.SPOKENTO=1 ON=I shall undertake this task ON=I accept this task IF (> == 0) SPEECHCOLOR=026 SAYU I do not believe I have discussed any tasks with thee... SPEECHCOLOR=0481 RETURN 1 ENDIF IF (> = 0) SRC.TAG.CURRENTQUESTS=0 ENDIF SRC.TAG.CURRENTQUESTS = + 1> VAR.QUESTUID= SRC.TRYP 0 SRC.TAG.QUEST = VAR.QUESTUID= SRC.SYSMESSAGE New Task: Slay SRC.SFX 548 TAG.PLAYERASKING= TAG.SPOKENTO= TAG.OLDNPCNAME= TAG.OLDNPCID= TAG.OLDPLACENAME= TAG.OLDPLACEP= SPEECHCOLOR=0481 SAYU Very well. If ye can slay this beast and bring its head to me within an hour and a half, I shall reward thee. If it becomes too much for thee, return to me and say "I resign from performing thine task". SPEECHCOLOR=0481 VAR.OLDACT= SRC.NEWNPC > SRC.ACT.P= VAR.NPCUID= VAR.NPCSNAME= SRC.ACT.HOME= SRC.ACT.HOMEDIST=1 SRC.ACT.FIX //Fix the ZLEVEL of the thing. SRC.ACT.HOME= SRC.NEWITEM i_flesh_head SRC.ACT.CONT=> SRC.ACT.NAME=Head of VAR.HEADUID= VAR.NPCSNAME= SRC.NEWITEM i_memory_quest SRC.ACT.CONT= SRC.ACT.LINK= SRC.ACT.MORE1=> SRC.ACT.MORE2=> SRC.ACT.MOREX=> VAR.NPCUID= VAR.HEADUID= TAG.QUESTDIFFICULTY= TAG.PLACEP= TAG.NPCID= SRC.ACT.TIMER=90*60 ON=I resign from performing thine task IF ( != ) SPEECHCOLOR=026 SAYU I do not believe ye are performing a task for me... SPEECHCOLOR=0481 RETURN 1 ELSE SPEECHCOLOR=01d4 SRC.TRYP 0 SRC.TAG.QUEST = SRC.TAG.CURRENTQUESTS = + (-1)> SRC.SYSMESSAGE Aborted Task: Slay SRC.SFX 548 SAYU Ah, truly? I shall have to find someone else to perform this task then... SPEECHCOLOR=0481 VAR.OLDACT= SRC.ACT=> SRC.ACT.REMOVE SRC.ACT=> SRC.ACT.REMOVE SRC.ACT=> VAR.OLDACT= FINDID.i_memory_quest.REMOVE IF ( > 50) SRC.FAME= +(-50)> ELSE SRC.FAME=0 ENDIF SRC.SYSMESSAGE You have lost a small amount of fame. RETURN 1 ENDIF [ITEMDEF i_memory_quest] DEFNAME=i_memory_quest ID=i_memory TYPE=t_eq_script LAYER=30 NAME=Quest memory item ON=@Create ATTR=attr_invis|attr_move_never ON=@Timer LINK.SYSMESSAGE It has taken you too long to fulfill your appointed task. LINK.FAME= + {-100 -50} IF ( < 1) LINK.FAME=0 ENDIF LINK.SYSMESSAGE You have lost a small amount of fame. LINK.TAG.CURRENTQUESTS = + (-1)> LINK.TRYP 0 LINK.TAG.QUEST = VAR.OLDACT= LINK.ACT=> LINK.SYSMESSAGE Task Failed: Slay LINK.SFX 548 LINK.ACT.REMOVE LINK.ACT=> LINK.ACT.REMOVE LINK.ACT=> REMOVE RETURN 1 [EVENTS e_accepthead] ON=@NPCAcceptItem IF ( == ) SRC.TRYP 0 SRC.TAG.QUEST = SRC.TAG.CURRENTQUESTS = + (-1)> SRC.SYSMESSAGE Completed Task: Slay SRC.SFX 548 SAY Ah, this is the . I thank thee... VAR.RANDITEM=rand(50) IF ( < 200) IF (> == 10) SAY Here is thine reward. SRC.NEWITEM=random_quest_reward_1 SRC.ACT.BOUNCE ELSEIF (> < 7) SAY I am sorry I have nothing to give thee... but I shall spread word of thy kindness. SRC.FAME= + {25 75} SRC.SYSMESSAGE You have gained some fame. ELSE SRC.NEWITEM i_gold SRC.ACT.AMOUNT={200 400} SAY I thank thee... here is gold. SRC.ACT.BOUNCE ENDIF ELSEIF ( < 200) IF (> == 10) SAY Here is thine reward. SRC.NEWITEM=random_quest_reward_2 SRC.ACT.BOUNCE ELSEIF (> < 7) SAY I am sorry I have nothing to give thee... but I shall spread word of thy kindness. SRC.FAME= + {50 150} SRC.SYSMESSAGE You have gained some fame. ELSE SRC.NEWITEM i_gold SRC.ACT.AMOUNT={350 500} SAY I thank thee... here is gold. SRC.ACT.BOUNCE ENDIF ELSEIF ( < 325) IF (> == 10) SAY Here is thine reward. SRC.NEWITEM=random_quest_reward_3 SRC.ACT.BOUNCE ELSEIF (> < 7) SAY I am sorry I have nothing to give thee... but I shall spread word of thy kindness. SRC.FAME= + {100 250} SRC.SYSMESSAGE You have gained large amounts of fame. ELSE SRC.NEWITEM i_gold SRC.ACT.AMOUNT={450 600} SAY I thank thee... here is gold. SRC.ACT.BOUNCE ENDIF ELSE IF (> == 10) SAY Here is thine reward. SRC.NEWITEM=random_quest_reward_4 SRC.ACT.BOUNCE ELSEIF (> < 7) SAY I am sorry I have nothing to give thee... but I shall spread word of thy kindness. SRC.FAME= + {250 400} SRC.SYSMESSAGE You have gained huge amounts of fame. ELSE SRC.NEWITEM i_gold SRC.ACT.AMOUNT={500 750} SAY I thank thee... here is gold. SRC.ACT.BOUNCE ENDIF ENDIF FINDID.i_memory_quest.REMOVE SRC.TARG.REMOVE IF ( > 10000) SRC.FAME=10000 ENDIF ENDIF RETURN 1 [TEMPLATE random_quest_reward_1] ITEM={ random_weapon_ruin 5 random_shield_defense 5 random_platemail_defense 5 random_ringmail_defense 5 random_chainmail_defense 5 random_leather_defense 5 random_weapon_might 1 random_shield_guarding 1 random_platemail_guarding 1 random_chainmail_guarding 1 random_ringmail_guarding 1 random_leather_guarding 1 } [TEMPLATE random_quest_reward_2] ITEM={ random_weapon_ruin 1 random_shield_defense 1 random_platemail_defense 1 random_ringmail_defense 1 random_chainmail_defense 1 random_leather_defense 1 random_weapon_might 5 random_shield_guarding 5 random_platemail_guarding 5 random_chainmail_guarding 5 random_ringmail_guarding 5 random_leather_guarding 5 random_weapon_force 2 random_shield_hardening 2 random_platemail_hardening 2 random_chainmail_hardening 2 random_ringmail_hardening 2 random_leather_hardening 2 } [TEMPLATE random_quest_reward_3] ITEM={ random_weapon_ruin 1 random_shield_defense 1 random_platemail_defense 1 random_ringmail_defense 1 random_chainmail_defense 1 random_leather_defense 1 random_weapon_might 1 random_shield_guarding 1 random_platemail_guarding 1 random_chainmail_guarding 1 random_ringmail_guarding 1 random_leather_guarding 1 random_weapon_force 5 random_shield_hardening 5 random_platemail_hardening 5 random_chainmail_hardening 5 random_ringmail_hardening 5 random_leather_hardening 5 random_weapon_power 2 random_shield_fortification 2 random_platemail_fortification 2 random_chainmail_fortification 2 random_ringmail_fortification 2 random_leather_fortification 2 i_tracker_mold 2} [TEMPLATE random_quest_reward_4] ITEM={ random_weapon_ruin 1 random_shield_defense 1 random_platemail_defense 1 random_ringmail_defense 1 random_chainmail_defense 1 random_leather_defense 1 random_weapon_might 1 random_shield_guarding 1 random_platemail_guarding 1 random_chainmail_guarding 1 random_ringmail_guarding 1 random_leather_guarding 1 random_weapon_force 1 random_shield_hardening 1 random_platemail_hardening 1 random_chainmail_hardening 1 random_ringmail_hardening 1 random_leather_hardening 1 random_weapon_power 5 random_shield_fortification 5 random_platemail_fortification 5 random_chainmail_fortification 5 random_ringmail_fortification 5 random_leather_fortification 5 i_tracker_mold 5 random_weapon_vanq 2 random_shield_invulnerability 2 random_platemail_invulnerability 2 random_chainmail_invulnerability 2 random_ringmail_invulnerability 2 random_leather_invulnerability 2 } [FUNCTION npcrandvalidlocation] IF ( != 1) VAR.RANDX=rand(6142) VAR.RANDY=rand(4093) IF (> > 5120) IF (> < 2000) //Speedup... this is almost all dungeon or Green Acres, neither of which we want. npcrandvalidlocation ENDIF ENDIF ELSE VAR.RANDX= VAR.RANDY=rand(1998) ENDIF P=>,>,1 VAR.RANDX= VAR.RANDY= FIX isnpcstuck IF (> != 0) npcrandvalidlocation ENDIF IF ( != 0) || ( != 0) npcrandvalidlocation ENDIF IF ( != 1) IF ( != 0) npcrandvalidlocation ENDIF ELSE IF ( == 0) npcrandvalidlocation ENDIF IF !(STRCMPI(,Dungeon)) npcrandvalidlocation ENDIF IF !(STRCMPI(,Dungeons)) npcrandvalidlocation ENDIF ENDIF IF !(STRCMPI(,Star Chamber)) //Let me know if there are any more regions that aren't player accessible. npcrandvalidlocation ENDIF IF !(STRCMPI(,Uncharted Territory)) //Just what I named my server's default region... npcrandvalidlocation ENDIF IF !(STRCMPI(,)) //The server's default region is too large and too vague. npcrandvalidlocation ENDIF [FUNCTION isnpcstuck] TAG.HOMEX= TAG.HOMEY= TAG.HOMEZ= TAG.STUCKCOUNTER=1 STUCKCHECK n STUCKCHECK ne STUCKCHECK nw STUCKCHECK s STUCKCHECK se STUCKCHECK sw STUCKCHECK e STUCKCHECK w P=>,>,> [FUNCTION STUCKCHECK] //We only check if we have yet to find a valid position to move to //This saves on wasted time and is a slight performance boost. IF (> != 0) P=>,>,> RUN IF (> != ) || (> != ) TAG.STUCKCOUNTER=0 ENDIF ENDIF [FUNCTION nearestregion] VAR.LOWESTDIR=40 VAR.CURRENTREGIONUID= //Called OLDACT2 because I call it in another script using OLDACT... VAR.OLDACT2= NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE N ACT.REMOVE NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE S ACT.REMOVE NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE E ACT.REMOVE NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE W ACT.REMOVE NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE NW ACT.REMOVE NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE NE ACT.REMOVE NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE SW ACT.REMOVE NEWNPC c_man_invisible ACT.NAME=" " ACT.P=

ACT.UNTILREGIONCHANGE SE ACT.REMOVE IF (> < 40) TAG.PLACENAME= ENDIF VAR.LOWESTDIRECTION= VAR.LOWESTDIR= ACT=> VAR.OLDACT2= [FUNCTION UNTILREGIONCHANGE] MOVE 10 IF (0> == 0) TAG.NORUNAWAYLOOPS=1 ELSE TAG.NORUNAWAYLOOPS = + 1> ENDIF IF (> == >) IF (> < 40) UNTILREGIONCHANGE ENDIF ENDIF IF (> < >) IF (> > 0) VAR.LOWESTDIR= IF (> < 10) VAR.LOWESTDIRECTION= is very near to the ELSEIF (> < 20) VAR.LOWESTDIRECTION= is somewhat near to the ELSEIF (> < 30) VAR.LOWESTDIRECTION= is somewhat far to the ELSEIF (> < 40) VAR.LOWESTDIRECTION= is very far to the ELSE VAR.LOWESTDIRECTION=It is nowhere near anywhere else ENDIF ENDIF ENDIF [FUNCTION tasks] IF (> = 0) SYSMESSAGE You are not currently performing any tasks for anyone. RETURN 1 ENDIF IF (> = 0) TAG.SELECTEDQUEST=0 ENDIF IF (> < >) TAG.SELECTEDQUEST= + 1> VAR.OLDACT= ACT=>> IF (( == 4)||(=c_h_warrior_guildmaster)) SYSMESSAGE Slay ENDIF ACT=> VAR.OLDACT= tasks ELSE TAG.SELECTEDQUEST=0 RETURN 1 ENDIF