3 scripts SOA

Post Reply
Alexandre24
Posts: 175
Joined: Thu Mar 13, 2014 10:15 pm
Location: Hawkesbury, Ontario, CANADA

3 scripts SOA

Post by Alexandre24 » Sun Apr 24, 2016 9:43 pm

Hello

I finished for me, three scripts but I think she has errors .

If anyone can try to correct them and send them to the DSP project, its 'll appreciate.

I 'm not really good for the code but I try to want to understand .


Here are my scripts:

Code: Select all

-----------------------------------
-- 
-- Zone: Western Adoulin
-- 
-----------------------------------

require("scripts/globals/settings");
package.loaded["scripts/zones/Western_Adoulin/TextIDs"] = nil;
require("scripts/zones/Western_Adoulin/TextIDs");

-----------------------------------
--  onInitialize
-----------------------------------

function onInitialize(zone)
end;

-----------------------------------
-- onZoneIn
-----------------------------------

function onZoneIn(player,prevZone)
cs = -1;
if ((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then
player:setPos(-142,4,-18,4);
end
return cs;
end;

-----------------------------------
-- onRegionEnter          
-----------------------------------

function onRegionEnter(player,region)
    local regionID =region:GetRegionID();
    if (regionID==1 and player:getCurrentMission(SOA) == HEARTWINGS_AND_THE_KINDHEARTED then
        player:startEvent(0x2);
    end
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;

Code: Select all

-----------------------------------
--  Area:   Western Adoulin
--  NPC:    Brenton
--  Location: E-8
-----------------------------------
package.loaded["scripts/zones/Western_Adoulin/TextIDs"] = nil;
-----------------------------------

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


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

function onTrigger(player,npc)
    if (player:getMissionStatus(SOA,PIONEER_REGISTRATION) then
    local Bayld = player:getCurrency("bayld");
    player:startEvent(0x3);
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);
if csid == 3 then
    player:completeMission(SOA,PIONEER_REGISTRATION);
    player:addKeyItem(PIONEER_S_BADGE);
    player:messageSpecial(KEYITEM_OBTAINED,PIONEER_S_BADGE);
    player:addKeyItem(MAP_OF_ADOULIN);
    player:messageSpecial(KEYITEM_OBTAINED,MAP_OF_ADOULIN);
    player:addCurrency("bayld", 1000);
    end
end;

Code: Select all

-----------------------------------
--  Area:   Western Adoulin
--  NPC:    Levil
--  Location: E-8
-----------------------------------
package.loaded["scripts/zones/Western_Adoulin/TextIDs"] = nil;
-----------------------------------

require("scripts/zones/Western_Adoulin/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/missions")


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

function onTrigger(player,npc)
    player:startEvent(0x4);
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;

Alexandre24
Posts: 175
Joined: Thu Mar 13, 2014 10:15 pm
Location: Hawkesbury, Ontario, CANADA

Re: 3 scripts SOA

Post by Alexandre24 » Sun Apr 24, 2016 9:46 pm

one more for the moment.

Code: Select all

-----------------------------------
-- Area: Ceizak Battlegrounds
-- NPC:  WayPoint#1
-- @pos -178.101 4.000 71.279 231
-----------------------------------

package.loaded["scripts/zones/Ceizak_Battlegrounds/TextIDs"] = nil;

require("scripts/globals/settings");
require("scripts/zones/Ceizak_Battlegrounds/TextIDs");
require("scripts/globals/Waypoint");

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

function onTrade(player,npc,trade)
end; 

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

function onTrigger(player,npc)

    waypointMenu( player, 0x5000, 36, 296 );
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);

    if (csid == 0x5000) then

        if (option == 1) then    
            player:setWaypoint();
            player:messageSpecial(Waypoint_SET);
        end
    end
end;

gedads
Developer
Posts: 171
Joined: Fri Jan 04, 2013 7:48 pm

Re: 3 scripts SOA

Post by gedads » Wed Apr 27, 2016 3:48 am

hi, dsp isn't focusing on soa content, but you can probably contribute in that topic :
viewforum.php?f=47
which was for post soa content where you can find some outdated script like old yorcia weald timer for bushes etc (probably not working anymore with the replacement method for automatisation.lua).

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: 3 scripts SOA

Post by whasf » Wed Apr 27, 2016 9:16 pm

gedads wrote:hi, dsp isn't focusing on soa content, but you can probably contribute in that topic :
viewforum.php?f=47
which was for post soa content where you can find some outdated script like old yorcia weald timer for bushes etc (probably not working anymore with the replacement method for automatisation.lua).
Actually, I think we are taking all pull requests now..
-- Whasf

Alexandre24
Posts: 175
Joined: Thu Mar 13, 2014 10:15 pm
Location: Hawkesbury, Ontario, CANADA

Re: 3 scripts SOA

Post by Alexandre24 » Thu Apr 28, 2016 11:47 am

OK thanks. I research how to pull this on github . I saw a tutorial on the forums that explain how.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: 3 scripts SOA

Post by TeoTwawki » Thu May 12, 2016 5:17 am

Actually, I think we are taking all pull requests now..
I saw it said before that the rule of thumb was that we avoided the very latest things, which is now no longer SoA. I guess it would be the Rhapsodies Eschan and high content level battles stuffs now.

Still, older content is proffered over newer content (we still have some Pre CoP things unfinished, and soooo many quests to script guys!)
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Post Reply