[SIZE=1][COLOR=#0000ff]function[/COLOR][/SIZE][SIZE=1] Main()[/SIZE]
[SIZE=1]Player = [/SIZE][SIZE=1][COLOR=#ff00ff]Actor[/COLOR][/SIZE][SIZE=1]()[/SIZE]
[SIZE=1]PlayerName = [/SIZE][SIZE=1][COLOR=#ff00ff]Name[/COLOR][/SIZE][SIZE=1](Player)[/SIZE]
[SIZE=1]Target = [/SIZE][SIZE=1][COLOR=#ff00ff]ContextActor[/COLOR][/SIZE][SIZE=1]()[/SIZE]
[SIZE=1]TargetName = [/SIZE][SIZE=1][COLOR=#ff00ff]Name[/COLOR][/SIZE][SIZE=1](Target)[/SIZE]
[SIZE=1].Template[/SIZE]
[SIZE=1][COLOR=#ff00ff]Persistent[/COLOR][/SIZE][SIZE=1]([/SIZE][SIZE=1][COLOR=#ff0000]1[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1]QuestName = [/SIZE][SIZE=1][COLOR=#808080]"Rats in the Feed"[/COLOR][/SIZE]
[SIZE=1]QuestResults = [/SIZE][SIZE=1][COLOR=#ff00ff]QuestStatus[/COLOR][/SIZE][SIZE=1](Player, QuestName)[/SIZE]
[SIZE=1]QuestReturn = [/SIZE][SIZE=1][COLOR=#808080]"Return to "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] TargetName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" to complete this quest."[/COLOR][/SIZE]
[SIZE=1]¡¡[/SIZE]
[SIZE=1][COLOR=#008200]// Objective Variables for Quest completion[/COLOR][/SIZE]
[SIZE=1]WaitRace = [/SIZE][SIZE=1][COLOR=#808080]"Rat"[/COLOR][/SIZE]
[SIZE=1]WaitClass = [/SIZE][SIZE=1][COLOR=#808080]"Critter"[/COLOR][/SIZE]
[SIZE=1]WaitKillQuantity = [/SIZE][SIZE=1][COLOR=#ff0000]5[/COLOR][/SIZE]
[SIZE=1][COLOR=#008200]// Variables for Rewards[/COLOR][/SIZE]
[SIZE=1]RewardMoney = [/SIZE][SIZE=1][COLOR=#ff0000]1000[/COLOR][/SIZE]
[SIZE=1]RewardXp = [/SIZE][SIZE=1][COLOR=#ff0000]200[/COLOR][/SIZE]
[SIZE=1]RewardItem = [/SIZE][SIZE=1][COLOR=#808080]"Bread"[/COLOR][/SIZE]
[SIZE=1]RewardItemQuantity = [/SIZE][SIZE=1][COLOR=#ff0000]5[/COLOR][/SIZE]
[SIZE=1]RewardFaction = [/SIZE][SIZE=1][COLOR=#808080]""[/COLOR][/SIZE]
[SIZE=1]RewardFactionValue = [/SIZE][SIZE=1][COLOR=#ff0000]0[/COLOR][/SIZE]
[SIZE=1]QuestStatusText = [/SIZE][SIZE=1][COLOR=#808080]"Help "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] TargetName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" by killing 5 rats !"[/COLOR][/SIZE]
[SIZE=1]D = [/SIZE][SIZE=1][COLOR=#ff00ff]OpenDialog[/COLOR][/SIZE][SIZE=1](Player, Target, TargetName)[/SIZE]
[SIZE=1][COLOR=#008200]// Player Greeting to NPC:[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]DialogOutput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"Hail "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] TargetName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]""[/COLOR][/SIZE][SIZE=1], [/SIZE][SIZE=1][COLOR=#ff0000]238,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]218,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]106[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]DoEvents[/COLOR][/SIZE][SIZE=1] ([/SIZE][SIZE=1][COLOR=#ff0000]1000[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#008200]// NPC Greeting to Player:[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]DialogOutput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"Hail "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] PlayerName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]""[/COLOR][/SIZE][SIZE=1], [/SIZE][SIZE=1][COLOR=#ff0000]164,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]238,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]108[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]DoEvents[/COLOR][/SIZE][SIZE=1] ([/SIZE][SIZE=1][COLOR=#ff0000]1000[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=1] (QuestResults $= [/SIZE][SIZE=1][COLOR=#808080]""[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#008200]// The quest needs to be started[/COLOR][/SIZE]
[SIZE=1].start[/SIZE]
[SIZE=1][COLOR=#ff00ff]DialogOutput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"This months supply of oats was taken by a blood thirsty pack of rats. You can find them off to the west."[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#ff00ff]CHR[/COLOR][/SIZE][SIZE=1]([/SIZE][SIZE=1][COLOR=#ff0000]44[/COLOR][/SIZE][SIZE=1]) [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" Kill 5 of them and I will reward you greatly! Will you help?"[/COLOR][/SIZE][SIZE=1], [/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]0[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1]Result = [/SIZE][SIZE=1][COLOR=#ff00ff]DialogInput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"Sure thing !"[/COLOR][/SIZE][SIZE=1], [/SIZE][SIZE=1][COLOR=#808080]"Aww but they are so cute !"[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=1] (Result == [/SIZE][SIZE=1][COLOR=#ff0000]1[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#008200]// Create the new quest[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]NewQuest[/COLOR][/SIZE][SIZE=1](Player, QuestName, QuestStatusText, [/SIZE][SIZE=1][COLOR=#ff0000]141,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]241,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]241[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1]QuestTemp = QuestName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]": "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] QuestStatusText[/SIZE]
[SIZE=1][COLOR=#ff00ff]Output[/COLOR][/SIZE][SIZE=1](Player, QuestTemp, [/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]CloseDialog[/COLOR][/SIZE][SIZE=1](Player, D)[/SIZE]
[SIZE=1].wait[/SIZE]
[SIZE=1][COLOR=#008200]// Wait for Kills[/COLOR][/SIZE]
[SIZE=1]WaitID = [/SIZE][SIZE=1][COLOR=#ff00ff]ActorID[/COLOR][/SIZE][SIZE=1](WaitRace, WaitClass)[/SIZE]
[SIZE=1][COLOR=#ff00ff]WaitKill[/COLOR][/SIZE][SIZE=1](Player, WaitID, WaitKillQuantity)[/SIZE]
[SIZE=1][COLOR=#ff00ff]UpdateQuest[/COLOR][/SIZE][SIZE=1](Player, QuestName, QuestReturn, [/SIZE][SIZE=1][COLOR=#ff0000]141,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]241,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]241[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1]QuestTemp = QuestName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]": "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] QuestReturn[/SIZE]
[SIZE=1][COLOR=#ff00ff]Output[/COLOR][/SIZE][SIZE=1](Player, QuestTemp, [/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#0000ff]Else[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]CloseDialog[/COLOR][/SIZE][SIZE=1](Player, D)[/SIZE]
[SIZE=1][COLOR=#0000ff]EndIf[/COLOR][/SIZE]
[SIZE=1][COLOR=#0000ff]ElseIf[/COLOR][/SIZE][SIZE=1] (QuestResults $= QuestReturn)[/SIZE]
[SIZE=1][COLOR=#008200]// The quest has been almost completed, assign rewards[/COLOR][/SIZE]
[SIZE=1].Rewards[/SIZE]
[SIZE=1][COLOR=#ff00ff]DialogOutput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"You have completed "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] QuestName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]""[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#ff00ff]CHR[/COLOR][/SIZE][SIZE=1]([/SIZE][SIZE=1][COLOR=#ff0000]44[/COLOR][/SIZE][SIZE=1]) [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" great job !"[/COLOR][/SIZE][SIZE=1], [/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1]DialogResult = [/SIZE][SIZE=1][COLOR=#ff00ff]DialogInput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"Goodbye"[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]CompleteQuest[/COLOR][/SIZE][SIZE=1](Player, QuestName)[/SIZE]
[SIZE=1][COLOR=#008200]// Item reward for Step/Quest[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]GiveItem[/COLOR][/SIZE][SIZE=1](Player, RewardItem, RewardItemQuantity)[/SIZE]
[SIZE=1][COLOR=#008200]// XP reward for Step/Quest[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]GiveXp[/COLOR][/SIZE][SIZE=1](Player, RewardXp)[/SIZE]
[SIZE=1][COLOR=#008200]// Money reward for Step/Quest[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]ChangeGold[/COLOR][/SIZE][SIZE=1](Player, RewardMoney)[/SIZE]
[SIZE=1][COLOR=#008200]// Faction change[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]ChangeFactionRating[/COLOR][/SIZE][SIZE=1](Player, RewardFaction, RewardFactionValue)[/SIZE]
[SIZE=1][COLOR=#ff00ff]Output[/COLOR][/SIZE][SIZE=1](Player, [/SIZE][SIZE=1][COLOR=#808080]"You take "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] RewardItemQuantity [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] RewardItem [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" and "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] RewardMoney [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]"gp and "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] RewardXp [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]"xp you have earnt it!"[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]CloseDialog[/COLOR][/SIZE][SIZE=1](Player, D)[/SIZE]
[SIZE=1][COLOR=#0000ff]ElseIf[/COLOR][/SIZE][SIZE=1] ([/SIZE][SIZE=1][COLOR=#ff00ff]QuestComplete[/COLOR][/SIZE][SIZE=1](Player, QuestName) == [/SIZE][SIZE=1][COLOR=#ff0000]1[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#008200]// The quest has been completed[/COLOR][/SIZE]
[SIZE=1].Completed[/SIZE]
[SIZE=1][COLOR=#ff00ff]DialogOutput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"Thanks for helping me out with "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] QuestName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]""[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#ff00ff]CHR[/COLOR][/SIZE][SIZE=1]([/SIZE][SIZE=1][COLOR=#ff0000]44[/COLOR][/SIZE][SIZE=1]) [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" I have no other quests for you at this time ... good day !"[/COLOR][/SIZE][SIZE=1], [/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]DoEvents[/COLOR][/SIZE][SIZE=1] ([/SIZE][SIZE=1][COLOR=#ff0000]1000[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]CloseDialog[/COLOR][/SIZE][SIZE=1](Player, D)[/SIZE]
[SIZE=1][COLOR=#0000ff]Else[/COLOR][/SIZE]
[SIZE=1][COLOR=#008200]// The quest has been started but not completed[/COLOR][/SIZE]
[SIZE=1].Incomplete[/SIZE]
[SIZE=1][COLOR=#ff00ff]DialogOutput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"You have not yet completed the "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] QuestName [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" quest for me!"[/COLOR][/SIZE][SIZE=1], [/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]DialogOutput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"You will need to begin your last task again"[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#ff00ff]CHR[/COLOR][/SIZE][SIZE=1]([/SIZE][SIZE=1][COLOR=#ff0000]44[/COLOR][/SIZE][SIZE=1]) [/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1][COLOR=#808080]" "[/COLOR][/SIZE][SIZE=1][COLOR=#808080]$+[/COLOR][/SIZE][SIZE=1] QuestStatusText, [/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255,[/COLOR][/SIZE][SIZE=1][COLOR=#ff0000]255[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1]DialogResult = [/SIZE][SIZE=1][COLOR=#ff00ff]DialogInput[/COLOR][/SIZE][SIZE=1](Player, D, [/SIZE][SIZE=1][COLOR=#808080]"Goodbye"[/COLOR][/SIZE][SIZE=1])[/SIZE]
[SIZE=1][COLOR=#ff00ff]CloseDialog[/COLOR][/SIZE][SIZE=1](Player, D)[/SIZE]
[SIZE=1][COLOR=#ff00ff]GoTo[/COLOR][/SIZE][SIZE=1](wait)[/SIZE]
[SIZE=1][COLOR=#0000ff]EndIf[/COLOR][/SIZE]
[SIZE=1][COLOR=#ff00ff]Return[/COLOR][/SIZE][SIZE=1]()[/SIZE]
[SIZE=1][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=1][COLOR=#0000ff]Function[/COLOR][/SIZE]
[SIZE=1]¡¡[/SIZE]
[SIZE=1]¡¡[/SIZE]