Page 1 of 1

3 scripts SOA

Posted: Sun Apr 24, 2016 9:43 pm
by Alexandre24
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;

Re: 3 scripts SOA

Posted: Sun Apr 24, 2016 9:46 pm
by Alexandre24
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;

Re: 3 scripts SOA

Posted: Wed Apr 27, 2016 3:48 am
by gedads
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).

Re: 3 scripts SOA

Posted: Wed Apr 27, 2016 9:16 pm
by whasf
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..

Re: 3 scripts SOA

Posted: Thu Apr 28, 2016 11:47 am
by Alexandre24
OK thanks. I research how to pull this on github . I saw a tutorial on the forums that explain how.

Re: 3 scripts SOA

Posted: Thu May 12, 2016 5:17 am
by TeoTwawki
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!)