Cruor NPC

Post Reply
soulsin
Posts: 102
Joined: Sun Mar 17, 2013 9:06 am

Cruor NPC

Post by soulsin » Tue Apr 07, 2015 11:54 am

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;
[GM] Soulsin

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

Re: Cruor NPC

Post by TeoTwawki » Tue Apr 07, 2015 12:26 pm

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.
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

soulsin
Posts: 102
Joined: Sun Mar 17, 2013 9:06 am

Re: Cruor NPC

Post by soulsin » Tue Apr 07, 2015 12:36 pm

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
[GM] Soulsin

Post Reply