mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 22:14:39 +02:00
Fixed up some lua scripts. Fleshed out the dream stuff for Hildie quests. NOTE: Finish player.lua as it has pseudo code.
This commit is contained in:
parent
c3b4735cc5
commit
5c0d2c1d7f
7 changed files with 84 additions and 21 deletions
|
@ -1,23 +1,63 @@
|
|||
require ("global")
|
||||
|
||||
DREAM_ITEM = {
|
||||
{[1] = 3010419, [2] = 3010420, [3] = 3010421}, -- Mizzenmast/Roost/Hourglass Biscuit
|
||||
3010003, -- Boiled Egg
|
||||
3010101, -- Grilled Carp
|
||||
3010001, -- Meat Miq'abob
|
||||
3010402, -- Ginger Cookie
|
||||
3020001, -- Potion
|
||||
3020101, -- Ether
|
||||
1000003, -- 5x Crystal Shards (Fire)
|
||||
1000004, -- 5x Crystal Shards (Ice)
|
||||
1000005, -- 5x Crystal Shards (Wind)
|
||||
1000006, -- 5x Crystal Shards (Earth)
|
||||
1000007, -- 5x Crystal Shards (Lightning)
|
||||
1000008 -- 5x Crystal Shards (Water)
|
||||
}
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
|
||||
choice = callClientFunction(player, "askLogout", player);
|
||||
local choice = callClientFunction(player, "askLogout", player);
|
||||
|
||||
-- Quit
|
||||
if (choice == 2) then
|
||||
player:SetSleeping();
|
||||
player:QuitGame();
|
||||
-- Logout
|
||||
elseif (choice == 3) then
|
||||
player:SetSleeping();
|
||||
player:Logout();
|
||||
-- Heck the bed
|
||||
elseif (choice == 4) then
|
||||
player:SendMessage(33, "", "Heck the bed");
|
||||
-- Give items based on dream
|
||||
local dreamCode = player:GetLoginDreamCode();
|
||||
if (dreamCode >= 21 and dreamCode <= 33) then
|
||||
local innCode = player:GetInnCode();
|
||||
local itemCode = DREAM_ITEM[dreamCode - 20];
|
||||
|
||||
-- Get biscuit for inn
|
||||
if (dreamCode == 21) then
|
||||
itemCode = itemCode[innCode];
|
||||
end
|
||||
|
||||
-- If crystals you get x5 otherwise x1.
|
||||
if (dreamCode > = 28 and dreamCode <= 33) then
|
||||
player:AddItem(itemCode, 5);
|
||||
else
|
||||
player:AddItem(itemCode, 1);
|
||||
end
|
||||
|
||||
-- Clear the code so they player doesn't keep getting things
|
||||
player:SetLoginDreamCode(0);
|
||||
else
|
||||
-- Otherwise show standard message
|
||||
player:SendGameMessage(player, npc, 7, 0x20);
|
||||
end
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
|
@ -5,14 +5,5 @@ function init(npc)
|
|||
end
|
||||
|
||||
function onEventStarted(player, npc, eventType, eventName)
|
||||
|
||||
if (eventType == ETYPE_PUSH) then
|
||||
if (eventName == "caution") then
|
||||
worldMaster = GetWorldMaster();
|
||||
player:SendGameMessage(player, worldMaster, 34109, 0x20);
|
||||
elseif (eventName == "exit") then
|
||||
GetWorldManager():DoPlayerMoveInZone(player, 5.36433, 196, 133.656, -2.84938);
|
||||
end
|
||||
end
|
||||
player:EndEvent();
|
||||
end
|
|
@ -27,10 +27,10 @@ function onEventStarted(player, privAreaExit, eventType, eventName)
|
|||
-- If you can leave, warp to public zone and show message.
|
||||
if (area.CanExitPrivateArea()) then
|
||||
player:SendGameMessage(player, GetWorldMaster(), 34110, MESSAGE_TYPE_SYSTEM); -- You have left the instance.
|
||||
GetWorldManager():WarpToPublicArea(player);
|
||||
--GetWorldManager():WarpToPublicArea(player);
|
||||
-- Otherwise warp back to the center of the zone.
|
||||
else
|
||||
GetWorldManager():WarpToCharaPosition(player, privAreaExit);
|
||||
--GetWorldManager():WarpToCharaPosition(player, privAreaExit);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue