Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------
- -- func: applynoobperks
- -- desc: Applies settings for new characters
- -- as found in settings.lua
- --------------------------------------------
- require("scripts/globals/settings");
- cmdprops =
- {
- permission = 1,
- parameters = "s" -- s = string, i = int
- };
- function onTrigger(player, p1)
- local target;
- if (p1 ~= nil) then
- target = GetPlayerByName(p1);
- if (target == nil) then
- player:PrintToPlayer(string.format("Player named '%s' not found!", p1));
- return;
- end
- player:PrintToPlayer(string.format("Applying noob perks to '%s'.", p1));
- else
- target = player
- end
- target.PrintToPlayer("Noob perks have been applied to you.")
- ----- settings.lua Perks -----
- if (ADVANCED_JOB_LEVEL == 0) then
- for i = 6,22 do
- target:unlockJob(i);
- end
- end
- if (SUBJOB_QUEST_LEVEL == 0) then
- target:unlockJob(0);
- end
- if (ALL_MAPS == 1) then
- for i=385,447 do
- target:addKeyItem(i);
- end
- for i=1856,1917 do
- target:addKeyItem(i);
- end
- for i=2302,2305 do
- target:addKeyItem(i);
- end
- for i=2307,2309 do
- target:addKeyItem(i);
- end
- end
- if (INITIAL_LEVEL_CAP ~= 50) then
- target:levelCap(INITIAL_LEVEL_CAP)
- end
- if (START_INVENTORY > 30) then
- target:changeContainerSize(0,(START_INVENTORY - 30))
- target:changeContainerSize(5,(START_INVENTORY - 30))
- end
- if (UNLOCK_OUTPOST_WARPS >= 1) then
- target:addNationTeleport(0,2097120);
- target:addNationTeleport(1,2097120);
- target:addNationTeleport(2,2097120);
- if (UNLOCK_OUTPOST_WARPS == 2) then -- Tu'Lia and Tavnazia
- target:addNationTeleport(0,10485760);
- target:addNationTeleport(1,10485760);
- target:addNationTeleport(2,10485760);
- end
- end
- ----- End settings.lua Perks -----
- -- SET START GIL
- --[[For some intermittent reason m_ZoneList ends up empty on characters, which is
- possibly also why they lose key items. When that happens, CharCreate will be run and
- they end up losing their gil to the code below. Added a conditional to hopefully
- prevent that until the bug is fixed. Used the if instead of addGil to prevent abuse
- on servers with very high values of START_GIL, I guess.]]
- if (target:getGil() < START_GIL) then
- target:setGil(START_GIL);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement