Page 1 of 1

Cruor NPC

Posted: Tue Apr 07, 2015 11:54 am
by soulsin
Here is script I have for our Cruor NPC but on the player:startEvent(0x07D2,player:getCruor()); I get call method 'get cruor' (a nil value) what am I missing


-----------------------------------
-- Area: Abyssea-Konschtat
-- NPC: Cruor Prospector
--
-----------------------------------

require("scripts/globals/settings");
package.loaded["scripts/zones/Abyssea-Vunkerl/TextIDs"] = nil;
require("scripts/zones/Abyssea-Vunkerl/TextIDs");
require("scripts/globals/abyssea");
require("scripts/globals/common");
require("scripts/globals/missions");
-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

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

function onTrigger(player,npc)
player:startEvent(0x07D2,player:getCruor());
print("onEventSelection")
print("onEventSelection - CSID:",csid);
print("onEventSelection - option ===",option);
end;

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

function onEventUpdate(player,csid,option)
-- if (CSID == 0x07D2) then
print("onEventSelection")
print("onEventSelection - CSID:",csid);
print("onEventSelection - option ===",option);

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

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

function onEventFinish(player,csid,option)

print("onEventSelection")
print("onEventSelection - CSID:",csid);
print("onEventSelection - option ===",option);
local abysseaTime = player:getVar("Abysseatime");
if (option >= 552) then
cost = 0;
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;

Re: Cruor NPC

Posted: Tue Apr 07, 2015 12:26 pm
by TeoTwawki
you want

Code: Select all

getCurrency("cruor")
not getCruor()

I've already done partial work on thees, enough that people should be able to copy paste fill in both the missing bits by looking at other NPC scripts and be able to do the same NPC in the other abyssea zones with juts some minor changes (like correcting which KI's are in script to reflect those shown in the in game menu). https://github.com/TeoTwawki/darkstar/b ... or.lua#L28

Most of what I did is already merged into DarkStar with more on its way to pull requests when I have time.


p.s.
Use code tags when posting code. Alternatively, use either pastebin or privatepaste and remember to select the right language parser. Also you pasted code has require lines that you likely will never need in that npc.

Re: Cruor NPC

Posted: Tue Apr 07, 2015 12:36 pm
by soulsin
Ok thanks. Some of this was just from old server files was working on and came across it and wanted to see if it work