Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Quest script by Nautical
- local quest = {
- // Quest/Mission information
- id = "ancientskull",
- name = "The Ancient Skull",
- description = "My buddy Brent has lost\nhis prized skulls. These things\ndate all the way back\nto around 200 BCE.\nHe is going absolutely\nnuts without the thing.\nPlease find and return\nit.",
- objectives = "Retrieve 3 Ancient Skulls",
- rewards = "A pat on the back\n$200 cash",
- setupInstructions = "Place skull spawns around\nthe map. You can place as many\nas you like! So try to make it a\nchallenge to find the watermelons.",
- pvp = false,
- daily = false, // makes this quest a non-daily quest
- // Quest/Mission data
- spawnModel = "models/Gibs/HGIBS.mdl",
- spawnClass = "missionmod_collectable",
- credit = 0, // how much credit do we have for completing objectives?
- toCleanup = {},
- };
- // Called when a player starts this quest
- function quest:OnStart(ply)
- for i = 1,3 do
- local spawns = hook.Call("missionmod_GetQuestSpawns", nil, self.id);
- local wm = ents.Create(self.spawnClass);
- wm:MissionMod_SetQuest(self.id);
- wm:Spawn();
- wm:MissionMod_ChangeModel(self.spawnModel);
- hook.Call("missionmod_SpawnAt", nil, wm, spawns, self.spawnClass);
- table.insert(self.toCleanup, wm);
- end
- end
- // Called when we want to cleanup
- function quest:Cleanup()
- for k,v in next, self.toCleanup do
- if (IsValid(v)) then
- v:Remove();
- end
- end
- end
- // Checks to see if our quest is ready to be turned in
- function quest:CheckGoals()
- if (self.credit > 2) then
- return true;
- end
- return false;
- end
- // Gets called when a player completes the quest and is to receive rewards
- function quest:OnGiveRewards(ply)
- if (ply.addMoney) then
- ply:addMoney(200);
- end
- end
- // Register the quest with mission mod
- hook.Call("missionmod_RegisterQuest", nil, quest);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement