Forgot script.

This commit is contained in:
Filip Maj 2018-04-10 01:07:38 -04:00
parent 1d3dd99414
commit 7abfbd5953

View File

@ -10,6 +10,12 @@ eventTalkStepMakeupDone() - Confirm when creating LS
eventTalkStepModifyDone() - Confirm when modding LS eventTalkStepModifyDone() - Confirm when modding LS
eventTalkStepBreakDone() - Confirm when deleting LS eventTalkStepBreakDone() - Confirm when deleting LS
Text IDs:
25121 - That [@SWITCH($E8(1),linkshell,company)] name is already being used.
25122 - That [@SWITCH($E8(1),linkshell,company)] name cannot be used.
25123 - The [@SWITCH($E8(1),linkshell,company)] [@STRING($EA(2))] has been [@SWITCH($E8(1),created,founded)].
--]] --]]
require ("global") require ("global")
@ -18,41 +24,46 @@ function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function createLinkshell(name, crest) function createLinkshell(player, name, crest)
GetWorldManager():RequestWorldLinkshellCreate(player, name, crest);
return waitForSignal("ls_result");
end
function modifyLinkshell(player, name, crest)
end end
function modifyLinkshell(name, crest) function disbandLinkshell(player, name, crest)
end
function disbandLinkshell(name, crest)
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
hasNoActiveLS = false; local hasNoActiveLS = false;
callClientFunction(player, "eventTalkStep1", hasNoActiveLS); callClientFunction(player, "eventTalkStep1", hasNoActiveLS);
command, lsName, crestId = callClientFunction(player, "eventTalkStep2", hasNoActiveLS); local command, lsName, crestId = callClientFunction(player, "eventTalkStep2", hasNoActiveLS);
--Create --Create
if (result == 3) then if (command == 3) then
local result = createLinkshell(player, lsName, crestId);
player:SendMessage(0x20, "", "" .. tostring(lsName)); if (result == 0) then
player:SendMessage(0x20, "", "" .. tostring(crestId));
player:SendMessage(0x20, "", "" .. tostring(command));
createLinkshell(lsName, crestId);
callClientFunction(player, "eventTalkStepMakeupDone"); callClientFunction(player, "eventTalkStepMakeupDone");
elseif (result == 1) then
player:SendGameMessage(player, GetWorldMaster(), 25121, 0x20); --LS already exists
callClientFunction(player, "eventTalkStepBreakDone");
elseif (result == 2) then
player:SendGameMessage(player, GetWorldMaster(), 25122, 0x20); --Cannot use this name (reserved/banned)
callClientFunction(player, "eventTalkStepBreakDone");
elseif (result == 3) then
end
--Modify --Modify
elseif (result == 4) then elseif (command == 4) then
modifyLinkshell(lsName, crestId); modifyLinkshell(player, lsName, crestId);
callClientFunction(player, "eventTalkStepModifyDone"); callClientFunction(player, "eventTalkStepModifyDone");
--Disband --Disband
elseif (result == 5) then elseif (command == 5) then
disbandLinkshell(lsName, crestId); disbandLinkshell(player, lsName, crestId);
callClientFunction(player, "eventTalkStepBreakDone"); callClientFunction(player, "eventTalkStepBreakDone");
end end