Page 1 of 1

North Gustaberg Lcypodium and teleports

Posted: Tue May 15, 2018 7:23 am
by jono659
Threw this together, no-one seems interested so feel free to play around.

Cliff bottom Present day

Code: Select all

-----------------------------------
-- Area: North Gustaberg bottom
--  NPC: no_name_1)
-- Notes: Use to warp up the cliff
-- JonO659
-----------------------------------
package.loaded["scripts/zones/North_Gustaberg/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/zones/North_Gustaberg/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
local lywarp = player:getVar("lywarpgus");
if (trade:hasItemQty(956,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(957,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(958,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(949,1) and lywarp == 1) then
        player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(959,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(948,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(1120,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(2554,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(1725,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(1410,1) and lywarp == 1) then
    player:startEvent(0x0109);
    player:tradeComplete();
elseif (trade:hasItemQty(1411,1) and lywarp == 1) then
    player:startEvent(0x0109);
elseif (trade:hasItemQty(1413,1) and lywarp == 1) then
    player:startEvent(0x0109);  
    player:tradeComplete();
else 
    player:messageSpecial(NOTHING_HAPPENS);
    return;
end
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
    player:messageSpecial(NOTHING_HAPPENS);
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)

    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
end;

Re: North Gustaberg Lcypodium and teleports

Posted: Tue May 15, 2018 7:25 am
by jono659
Cliff top present day

Code: Select all

-----------------------------------
-- Area: North Gustaberg top
--  NPC: no_name_0)
-- Notes: Use to warp down the cliff
-- JonO659
-----------------------------------
package.loaded["scripts/zones/North_Gustaberg/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/zones/North_Gustaberg/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
local lywarp = player:getVar("lywarpgus");
if (trade:hasItemQty(956,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(957,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(958,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(949,1) and lywarp == 1) then
        player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(959,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(948,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(1120,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(2554,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(1725,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(1410,1) and lywarp == 1) then
    player:startEvent(0x0108);
    player:tradeComplete();
elseif (trade:hasItemQty(1411,1) and lywarp == 1) then
    player:startEvent(0x0108);
elseif (trade:hasItemQty(1413,1) and lywarp == 1) then
    player:startEvent(0x0108);  
    player:tradeComplete();
else 
    player:messageSpecial(NOTHING_HAPPENS);
    return;
end
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
    player:messageSpecial(NOTHING_HAPPENS);
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)

    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
end;

Re: North Gustaberg Lcypodium and teleports

Posted: Tue May 15, 2018 7:26 am
by jono659
Lycopodium on the ramp Past

Code: Select all

-----------------------------------
-- Area: North Gustaberg [S] Ramp
--  NPC: Lycopodium)
--  @pos -272 12.5 260
-- Notes: Use enable cliff warping
-- JonO659
-----------------------------------
package.loaded["scripts/zones/North_Gustaberg_[S]/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/zones/North_Gustaberg_[S]/TextIDs");
require("scripts/globals/quests");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
    local lywarp = player:getVar("lywarpgus");
    if lywarp == 1 then
    player:messageSpecial(NOTHING_HAPPENS);
    else
    player:startEvent(113);
    end
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
    if (csid == 113) then
        player:setVar("lywarpgus",1);
    end

    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
end;

Re: North Gustaberg Lcypodium and teleports

Posted: Tue May 15, 2018 7:27 am
by jono659
SQL

Code: Select all

INSERT INTO `npc_list` VALUES (17212104,'no_name_0','     ',140,-258.186,-3.231,204.774,32769,40,40,0,0,0,0,27,0x0000160900000000000000000000000000000000,34,NULL,1);
INSERT INTO `npc_list` VALUES (17212105,'no_name_1','     ',236,-276.303,12.310,261.650,32769,40,40,0,0,0,0,27,0x0000160900000000000000000000000000000000,34,NULL,1);

Seems to work ok