(@@InputString)
;;--QFunction QFUNCTION AUTO COMMANDS-------------------------------------------------

;;--OnKillMonster----------------------------------------------

[@KillMonster]

;;--KillChainQuestInitialize------

;CheckQuestType
#IF
CheckMission [$Quest_KillChain] 1
#ACT 
Goto @KillMonsterChainChecks
break

;Check if monster in list
#IF
CheckMission [$Quest_KillChain] 0
CheckTextList <$LASTKILLEDMOBNAME> ..\QuestDiary\QuestScripts\KillChain\MobNameList.txt
#ACT
goto @KillMonsterChainBegin

;;--------------------------------


;;-------------------------------------------------------------


;;--KillChainQuestStart-------------------

;;--SetupQuestInformation---------

[@KillMonsterChainBegin]
#IF
NOT CheckTextList Name:<$LASTKILLEDMOBNAME>-QuestLevel:1 ..\QuestDiary\QuestScripts\KillChain\MobQuestLevel.txt 
NOT CheckTextList Name:<$LASTKILLEDMOBNAME>-QuestLevel:3 ..\QuestDiary\QuestScripts\KillChain\MobQuestLevel.txt 
NOT CheckTextList Name:<$LASTKILLEDMOBNAME>-QuestLevel:2 ..\QuestDiary\QuestScripts\KillChain\MobQuestLevel.txt 
#ACT
goto @KillMonsterRandom
break

#IF
RANDOM 100
CheckTextList Name:<$LASTKILLEDMOBNAME>-QuestLevel:1 ..\QuestDiary\QuestScripts\KillChain\MobQuestLevel.txt 
#ACT
SetMission [$Quest_KillChain] 1
ADDMISSION 1 KillChain1
UPDATEMISSIONTIME 1 [$Quest_KillChainLvl1_Time]
AddTextList <$LASTKILLEDMOBNAME>-1 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
DelayGoto [$Quest_KillChainLvl1_Time2] @KillMonsterChainFail QuestKillChain
SendMsg 7 "You have set off a Kill Chain, prepare yourself!"
SendMsg 7 "You have [$Quest_KillChainLvl1_Time2] Seconds to kill 10 <$LASTKILLEDMOBNAME>, good luck!"
break

#IF
RANDOM 120
CheckTextList Name:<$LASTKILLEDMOBNAME>-QuestLevel:2 ..\QuestDiary\QuestScripts\KillChain\MobQuestLevel.txt 
#ACT
SetMission [$Quest_KillChain] 1
ADDMISSION 1 KillChain2
UPDATEMISSIONTIME 1 [$Quest_KillChainLvl2_Time]
AddTextList <$LASTKILLEDMOBNAME>-2 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
DelayGoto [$Quest_KillChainLvl2_Time2] @KillMonsterChainFail QuestKillChain
SendMsg 7 "You have set off a Kill Chain, prepare yourself!"
SendMsg 7 "You have [$Quest_KillChainLvl2_Time2] Seconds to kill 15 <$LASTKILLEDMOBNAME>, good luck!"
break

#IF
RANDOM 140
CheckTextList Name:<$LASTKILLEDMOBNAME>-QuestLevel:3 ..\QuestDiary\QuestScripts\KillChain\MobQuestLevel.txt 
#ACT
SetMission [$Quest_KillChain] 1
ADDMISSION 1 KillChain3
UPDATEMISSIONTIME 1 [$Quest_KillChainLvl3_Time]
AddTextList <$LASTKILLEDMOBNAME>-3 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
DelayGoto [$Quest_KillChainLvl3_Time2] @KillMonsterChainFail QuestKillChain
SendMsg 7 "You have set off a Kill Chain, prepare yourself!"
SendMsg 7 "You have [$Quest_KillChainLvl3_Time2] Seconds to kill 20 <$LASTKILLEDMOBNAME>, good luck!"
break

;;--------------------------------

;;--RandomChecks------------------

[@KillMonsterRandom]
#IF
RANDOM 40
#ACT
SetMission [$Quest_KillChain] 1
ADDMISSION 1 KillChain1
UPDATEMISSIONTIME 1 [$Quest_KillChainLvl1_Time]
AddTextList <$LASTKILLEDMOBNAME>-1 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
DelayGoto [$Quest_KillChainLvl1_Time2] @KillMonsterChainFail QuestKillChain
SendMsg 7 "You have set off a Kill Chain, prepare yourself!"
SendMsg 7 "You have [$Quest_KillChainLvl1_Time2] Seconds to kill 10 <$LASTKILLEDMOBNAME>, good luck!"
break

#IF
RANDOM 40
#ACT
SetMission [$Quest_KillChain] 1
ADDMISSION 1 KillChain2
UPDATEMISSIONTIME 1 [$Quest_KillChainLvl2_Time]
AddTextList <$LASTKILLEDMOBNAME>-2 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
DelayGoto [$Quest_KillChainLvl2_Time2] @KillMonsterChainFail QuestKillChain
SendMsg 7 "You have set off a Kill Chain, prepare yourself!"
SendMsg 7 "You have [$Quest_KillChainLvl2_Time2] Seconds to kill 15 <$LASTKILLEDMOBNAME>, good luck!"
break

#IF
RANDOM 40
#ACT
SetMission [$Quest_KillChain] 1
ADDMISSION 1 KillChain3
UPDATEMISSIONTIME 1 [$Quest_KillChainLvl3_Time]
AddTextList <$LASTKILLEDMOBNAME>-3 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
DelayGoto [$Quest_KillChainLvl3_Time2] @KillMonsterChainFail QuestKillChain
SendMsg 7 "You have set off a Kill Chain, prepare yourself!"
SendMsg 7 "You have [$Quest_KillChainLvl3_Time2] Seconds to kill 20 <$LASTKILLEDMOBNAME>, good luck!"
break

;;--------------------------------

;;--CheckQuestLevel---------------

[@KillMonsterChainChecks]
#IF
CheckTextList <$LASTKILLEDMOBNAME>-3 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
#ACT
goto @KillMonsterChainLvl3P
break
#IF
CheckTextList <$LASTKILLEDMOBNAME>-2 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
#ACT
goto @KillMonsterChainLvl2P
break
#IF
CheckTextList <$LASTKILLEDMOBNAME>-1 ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
#ACT
goto @KillMonsterChainLvl1P

;;--------------------------------

;;--KCLevel1QuestProgress---------

[@KillMonsterChainLvl1P]
#IF
CHECKMISSIONKILLMONCOUNT 1 1 < 10
#ACT
CHANGEMISSIONKILLMONCOUNT 1 1 + 1
#Elseact
break

#IF
CHECKMISSIONKILLMONCOUNT 1 1 = 10
#ACT
SetMission [$Quest_KillChain] 0
DelMission 1
ClearNameList ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
ClearDelayGoto QuestKillChain
goto @KillMonsterChainReward1
break
#ElseAct
break

[@KillMonsterChainReward1]
#CALL [\\QuestScripts\KillChain\QuestRewards.txt] @QuestRewards1

;;--------------------------------

;;--KCLevel2QuestProgress---------

[@KillMonsterChainLvl2P]
#IF
CHECKMISSIONKILLMONCOUNT 1 1 < 15
#ACT
CHANGEMISSIONKILLMONCOUNT 1 1 + 1
#Elseact
break

#IF
CHECKMISSIONKILLMONCOUNT 1 1 = 15
#ACT
SetMission [$Quest_KillChain] 0
DelMission 1
ClearNameList ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
ClearDelayGoto QuestKillChain
goto @KillMonsterChainReward2
break
#ElseAct
break

[@KillMonsterChainReward2]
#CALL [\\QuestScripts\KillChain\QuestRewards.txt] @QuestRewards2

;;--------------------------------

;;--KCLevel3QuestProgress---------

[@KillMonsterChainLvl3P]
#IF
CHECKMISSIONKILLMONCOUNT 1 1 < 20
#ACT
CHANGEMISSIONKILLMONCOUNT 1 1 + 1
#Elseact
break

#IF
CHECKMISSIONKILLMONCOUNT 1 1 = 20
#ACT
SetMission [$Quest_KillChain] 0
DelMission 1
ClearNameList ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
ClearDelayGoto QuestKillChain
goto @KillMonsterChainReward3
break
#ElseAct
break

[@KillMonsterChainReward3]
#CALL [\\QuestScripts\KillChain\QuestRewards.txt] @QuestRewards3

;;--------------------------------

;;--FailTheKillChain--------------

[@KillMonsterChainFail]
#IF
#ACT
SetMission [$Quest_KillChain] 0
DelMission 1
ClearNameList ..\QuestDiary\QuestScripts\KillChain\Characters\<$USERNAME>.txt
SendMsg 5 "Time has run out, you have failed the quest!"
break

;;----------------------------------------

;[@PlayDie]

;[@KillPlay]

;[@PlayLevelUp]

;[@PlayLevelUpEx]

;[@PlayRevive]

;;--EquipingItems----------------------------------------------

[@TakeOnItem]
;Need a command to check the last take on of item type/name?
;Check If Horse Items
#IF
Check [$TAKEONHORSEFLAG] 0
#ACT
GOTO @HorseTakeOn

;;-------------------------------------------------------------

;;--UnEquipingItems--------------------------------------------

[@TakeOffItem]

#IF
Check [$TAKEONHORSEFLAG] 1
#ACT
goto @HorseTakeOff

;;-------------------------------------------------------------

;;--Horse Take on and off--------------------------------------

;Horse Of
[@HorseTakeOff]
#IF
CHECKITEMTYPE 13 33
#ACT
SET [$TAKEONHORSEFLAG] 1
break
#ELSEACT
SET [$TAKEONHORSEFLAG] 0

#IF
CHECKITEMTYPE 13 32
#ACT
SET [$TAKEONHORSEFLAG] 1
break
#ELSEACT
SET [$TAKEONHORSEFLAG] 0

;Horse On
[@HorseTakeOn]
#IF
CHECKITEMTYPE 13 33
#ACT
SET [$TAKEONHORSEFLAG] 1
Sendmsg 6 "To quickly mount your ride, press the the ('M') key on keyboard."
break

#IF
CHECKITEMTYPE 13 32
#ACT
SET [$TAKEONHORSEFLAG] 1
Sendmsg 6 "To quickly mount your ride, press the the ('M') key on keyboard."
break

;;-------------------------------------------------------------

;;------------------------------------------------------------------------------------

;AddTextList <$USERNAME>-<$LASTKILLEDMOBNAME>-<$DAY>|<$MONTH>|<$YEAR>-<$HOUR>|<$MINUTE>|<$SEC> ..\QuestDiary\Test.txt


;;--QFunction STDMODE ITEMS-----------------------------------------------------------


;;--ChestnutTree, ChestnutTree1 QFunction(STDMODE FUNCTION 1)--

[@StdModeFunc1]
#IF
#ACT
MOV S0 "Nothing was found from harvesting.."

#IF
RANDOM 30
#ACT
Give GoldChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 25
#ACT
Give SilverChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 20
#ACT
Give BronzeChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 15
#ACT
Give BrownChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 10
#ACT
Give BrownChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 5
#ACT
Give BrownChestnut 1
MOV S0 "Items successfully harvested.."

#IF
#ACT
Sendmsg 6 <$STR(S0)>
break

;;-------------------------------------------------------------


;;--ChestnutTree2 QFunction(STDMODE FUNCTION 1)----------------

[@StdModeFunc2]
#IF
#ACT
MOV S0 "Nothing was found from harvesting.."

#IF
RANDOM 20
#ACT
Give GoldChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 15
#ACT
Give SilverChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 10
#ACT
Give BronzeChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 5
#ACT
Give BrownChestnut 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 2
#ACT
Give BrownChestnut 1
MOV S0 "Items successfully harvested.."

#IF
#ACT
Sendmsg 6 <$STR(S0)>
break

;;-------------------------------------------------------------

;;--EbonyTree QFunction(STDMODE FUNCTION 3)--------------------

[@StdModeFunc3]
#IF
#ACT
MOV S0 "Nothing was found from harvesting.."

#IF
RANDOM 5
#ACT
Give EbonyFruit 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 2
#ACT
Give EbonyFruit 1
MOV S0 "Items successfully harvested.."

#IF
#ACT
Sendmsg 6 <$STR(S0)>
break

;;-------------------------------------------------------------

;;--Mushroom QFunction(STDMODE FUNCTION 4)---------------------

[@StdModeFunc4]
#IF
#ACT
MOV S0 "Nothing was found from harvesting.."

#IF
RANDOM 5
#ACT
Give Mushroom 1
MOV S0 "Items successfully harvested.."

#IF
RANDOM 2
#ACT
Give Mushroom 1
MOV S0 "Items successfully harvested.."

#IF
#ACT
Sendmsg 6 <$STR(S0)>
break

;;-------------------------------------------------------------

;;--Bush QFunction(STDMODE FUNCTION 5)-------------------------

[@StdModeFunc5]
;Bush

;;-------------------------------------------------------------

;;--DirtPile QFunction(STDMODE FUNCTION 6)---------------------

[@StdModeFunc6]
#CALL [\\Misc\DirtPileScriptList\DirtPileScript.txt] @DirtPile

;;-------------------------------------------------------------

;;--AshPile QFunction(STDMODE FUNCTION 7)----------------------

[@StdModeFunc7]
#CALL [\\Misc\AshPileScriptList\AshPileScript.txt] @AshPile

;;-------------------------------------------------------------


;;------------------------------------------------------------------------------------



;;--QFunction USER COMMANDS-----------------------------------------------------------



;;--Admin Menu QFunction(@ADMINMENU)---------------------------

[@USERCMD1]
#IF
ISADMIN 10
#SAY
<test call/@call>\
<Mount Give Test/@MountGive>\
<Quest Flags/@AdminQuestFlags>\
<CheckTextCommand/@CheckText>  <AddTextCommand/@AddText>  <DeleteTextCommand/@DelText>\
<Test Instance GhoulCave/@GhoulCaveInstanceCheck>\
<Test EXP Bonus buff/@ExpBonus>\
#ElseAct
Break
Close

[@call]
#CALL [\\NPC\BichonProvince\BichonWall\Navigation.txt] @main2

[@ExpBonus]
#IF
ISADMIN 10
#ACT
KILLMONEXPRATE 200 60
#SAY
X2 exp for 60 seconds\
<Back/@USERCMD1>\

[@GhoulCaveInstanceCheck]
#IF
;If there is a group already in this instance move..
CANMOVEECTYPE EvilGhoulCave
#ACT
MOVEECTYPE EvilGhoulCave 63 35
#ElseAct
goto @GhoulCaveInstance

[@GhoulCaveInstance]
#IF
CHECKECTYPE EvilGhoulCave
#ACT
CREATEECTYPE EvilGhoulCave 30
;CLEARECTYPEMON FBMAP 
MOBECTYPEMON FBMAP 69 99 Ghoul20 200 200
MOBECTYPEMON FBMAP 69 99 Ghoul21 20  200
MOVEECTYPE EvilGhoulCave 63 35
#Elsesay
No available instances available at this time.\ \
<Back/@USERCMD1>\

[@MountGive]
#IF
#ACT
DYNAMICGIVE BrownTiger 1

;No Deal
CHANGEGIVEITEM 2 0
;No Store
;CHANGEGIVEITEM 2 1
;No Repair
;CHANGEGIVEITEM 2 2
;No Drop Again?
;CHANGEGIVEITEM 2 3
;No Drop
;CHANGEGIVEITEM 2 4
;No Upgrade
;CHANGEGIVEITEM 2 5
;No Sell
CHANGEGIVEITEM 2 6
;Destroyed on drop
CHANGEGIVEITEM 2 7

;Change Level
CHANGEGIVEITEM 10 =40
;Change base exp
CHANGEGIVEITEM 11 0
;Change Max Exp
CHANGEGIVEITEM 12 12000000
;Needed to give..
CHANGEGIVEITEM 8

#SAY
<Back/@USERCMD1>\

[@CheckText]
#IF
CheckTextList <$USERNAME>-MONNAME ..\QuestDiary\Test.txt
#SAY
Worked\
<Back/@USERCMD1>\
#ElseSay
Failed\
<Back/@USERCMD1>\

[@AddText]
#IF
#ACT
AddTextList <$USERNAME>-MONNAME ..\QuestDiary\Test.txt
#SAY
<Back/@USERCMD1>\

[@DelText]
#IF
#ACT
DelTextList <$USERNAME>-MONNAME ..\QuestDiary\Test.txt
#SAY
<Back/@USERCMD1>\

[@AdminQuestFlags]
#IF
ISADMIN 10
#SAY
<Reset BeginnerQuest Part 1/@RBQP1>  |  <Activate BeginnerQuest Part 1/@ABQP1>\
<Reset BeginnerQuest Part 2/@RBQP2>  |  <Activate BeginnerQuest Part 2/@ABQP2>\
<Reset Quest1Part1/@RQ1P1>  |  <Complete Quest1Part1/@CQ1P1>\
<Reset Quest1Part2/@RQ1P2>  |  <Complete Quest1Part2/@CQ1P2>\
<Reset Quest2Part1/@RQ2P1>  |  <Complete Quest2Part1/@CQ2P1>\
<Reset KillChain/@KCR>\
#ElseAct
Break
Close

[@KCR]
#IF
#ACT
SetMission [$Quest_KillChain] 0
DelMission 1
ClearDelayGoto QuestKillChain
DelTextList <$USERNAME>-<$LASTKILLEDMOBNAME> ..\QuestDiary\QuestScripts\KillChain\KillChains.txt

;;-------------------------------------------------------------



;;------------------------------------------------------------------------------------

