First commit

This commit is contained in:
2025-02-26 13:42:34 +01:00
commit f465c9072c
2467 changed files with 426214 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
function onLogin(player)
if player:getStorageValue(17571) ~= 1 and not player:isFakePlayer() then
player:setStorageValue(17571, 1)
-- Items
player:addItem(3355, 1, true, -1, CONST_SLOT_HEAD)
player:addItem(3361, 1, true, -1, CONST_SLOT_ARMOR)
player:addItem(3559, 1, true, -1, CONST_SLOT_LEGS)
player:addItem(3552, 1, true, -1, CONST_SLOT_FEET)
player:addItem(3412, 1, true, -1, CONST_SLOT_LEFT)
player:addItem(3007, 1, true, 100, CONST_SLOT_RING)
player:addItem(2920, 1, true, -1, CONST_SLOT_AMMO)
if player:getVocation():getId() == 1 then
player:addItem(3074, 1, true, -1, CONST_SLOT_RIGHT)
elseif player:getVocation():getId() == 2 then
player:addItem(3066, 1, true, -1, CONST_SLOT_RIGHT)
elseif player:getVocation():getId() == 3 then
player:addItem(3277, 1, true, 5, CONST_SLOT_RIGHT)
elseif player:getVocation():getId() == 4 then
local weapons = { 3300, 3286, 3276 }
player:addItem(weapons[math.random(#weapons)], 1, true, -1, CONST_SLOT_RIGHT)
end
local container = Game.createItem(2854, 1)
container:addItem(3585, 1)
container:addItem(3031, 25)
container:addItem(3725, 5)
container:addItem(3003, 1)
container:addItem(3457, 1)
player:addItemEx(container, true, CONST_SLOT_BACKPACK)
-- Default Outfit
if player:getSex() == PLAYERSEX_FEMALE then
player:setOutfit({lookType = 136, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 95})
else
player:setOutfit({lookType = 128, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 95})
end
end
return true
end

View File

@@ -0,0 +1,158 @@
local tasks = {
-- Grizzly Adams
['crocodile'] = {taskerStorage = 17608, progressStorage = 17609, killsRequired = 100},
['tarantula'] = {taskerStorage = 17608, progressStorage = 17610, killsRequired = 100},
['carniphila'] = {taskerStorage = 17608, progressStorage = 17611, killsRequired = 50},
['merlkin'] = {taskerStorage = 17608, progressStorage = 17612, killsRequired = 100},
['kongra'] = {taskerStorage = 17608, progressStorage = 17612, killsRequired = 100},
['sibang'] = {taskerStorage = 17608, progressStorage = 17612, killsRequired = 100},
['thornback tortoise'] = {taskerStorage = 17608, progressStorage = 17613, killsRequired = 100},
['gargoyle'] = {taskerStorage = 17608, progressStorage = 17614, killsRequired = 65},
['quara constrictor scout'] = {taskerStorage = 17608, progressStorage = 17616, killsRequired = 200},
['quara hydromancer scout'] = {taskerStorage = 17608, progressStorage = 17616, killsRequired = 200},
['quara mantassin scout'] = {taskerStorage = 17608, progressStorage = 17616, killsRequired = 200},
['quara pincher scout'] = {taskerStorage = 17608, progressStorage = 17616, killsRequired = 200},
['quara predator scout'] = {taskerStorage = 17608, progressStorage = 17616, killsRequired = 200},
['ancient scarab'] = {taskerStorage = 17608, progressStorage = 17617, killsRequired = 125},
['wyvern'] = {taskerStorage = 17608, progressStorage = 17618, killsRequired = 100},
['bonebeast'] = {taskerStorage = 17608, progressStorage = 17619, killsRequired = 100},
['dragon'] = {taskerStorage = 17608, progressStorage = 17620, killsRequired = 200},
['quara constrictor'] = {taskerStorage = 17608, progressStorage = 17621, killsRequired = 600},
['quara hydromancer'] = {taskerStorage = 17608, progressStorage = 17621, killsRequired = 600},
['quara mantassin'] = {taskerStorage = 17608, progressStorage = 17621, killsRequired = 600},
['quara pincher'] = {taskerStorage = 17608, progressStorage = 17621, killsRequired = 600},
['quara predator'] = {taskerStorage = 17608, progressStorage = 17621, killsRequired = 600},
['giant spider'] = {taskerStorage = 17608, progressStorage = 17622, killsRequired = 500},
['banshee'] = {taskerStorage = 17608, progressStorage = 17623, killsRequired = 300},
['lich'] = {taskerStorage = 17608, progressStorage = 17624, killsRequired = 500},
['acolyte of the cult'] = {taskerStorage = 17608, progressStorage = 17625, killsRequired = 500},
['adept of the cult'] = {taskerStorage = 17608, progressStorage = 17625, killsRequired = 500},
['enlightened of the cult'] = {taskerStorage = 17608, progressStorage = 17625, killsRequired = 500},
['novice of the cult'] = {taskerStorage = 17608, progressStorage = 17625, killsRequired = 500},
['hydra'] = {taskerStorage = 17608, progressStorage = 17626, killsRequired = 650},
['serpent spawn'] = {taskerStorage = 17608, progressStorage = 17627, killsRequired = 800},
['behemoth'] = {taskerStorage = 17608, progressStorage = 17628, killsRequired = 700},
['dragon lord'] = {taskerStorage = 17608, progressStorage = 17629, killsRequired = 600},
['hand of cursed fate'] = {taskerStorage = 17608, progressStorage = 17630, killsRequired = 200},
['juggernaut'] = {taskerStorage = 17608, progressStorage = 17631, killsRequired = 200},
['frost troll'] = {taskerStorage = 17608, progressStorage = 17697, killsRequired = 100},
['swamp troll'] = {taskerStorage = 17608, progressStorage = 17698, killsRequired = 100},
['rat'] = {taskerStorage = 17608, progressStorage = 17699, killsRequired = 25},
['cave rat'] = {taskerStorage = 17608, progressStorage = 17699, killsRequired = 25},
['wolf'] = {taskerStorage = 17608, progressStorage = 17700, killsRequired = 100},
['winter wolf'] = {taskerStorage = 17608, progressStorage = 17700, killsRequired = 100},
['wasp'] = {taskerStorage = 17608, progressStorage = 17701, killsRequired = 100},
['larva'] = {taskerStorage = 17608, progressStorage = 17702, killsRequired = 100},
['dwarf'] = {taskerStorage = 17608, progressStorage = 17703, killsRequired = 100},
['skeleton'] = {taskerStorage = 17608, progressStorage = 17704, killsRequired = 100},
['ghoul'] = {taskerStorage = 17608, progressStorage = 17704, killsRequired = 100},
['elf'] = {taskerStorage = 17608, progressStorage = 17729, killsRequired = 200},
['elf scout'] = {taskerStorage = 17608, progressStorage = 17729, killsRequired = 200},
['elf arcanist'] = {taskerStorage = 17608, progressStorage = 17729, killsRequired = 200},
['bug'] = {taskerStorage = 17608, progressStorage = 17730, killsRequired = 40},
['smuggler'] = {taskerStorage = 17608, progressStorage = 17731, killsRequired = 250},
['wild warrior'] = {taskerStorage = 17608, progressStorage = 17731, killsRequired = 250},
['bandit'] = {taskerStorage = 17608, progressStorage = 17731, killsRequired = 250},
['hyaena'] = {taskerStorage = 17608, progressStorage = 17732, killsRequired = 30},
['lion'] = {taskerStorage = 17608, progressStorage = 17733, killsRequired = 20},
['bear'] = {taskerStorage = 17608, progressStorage = 17734, killsRequired = 35},
['slime'] = {taskerStorage = 17608, progressStorage = 17735, killsRequired = 100},
['beholder'] = {taskerStorage = 17608, progressStorage = 17736, killsRequired = 250},
['elder beholder'] = {taskerStorage = 17608, progressStorage = 17736, killsRequired = 250},
['green djinn'] = {taskerStorage = 17608, progressStorage = 17737, killsRequired = 500},
['blue djinn'] = {taskerStorage = 17608, progressStorage = 17737, killsRequired = 500},
['marid'] = {taskerStorage = 17608, progressStorage = 17737, killsRequired = 500},
['efreet'] = {taskerStorage = 17608, progressStorage = 17737, killsRequired = 500},
['pirate skeleton'] = {taskerStorage = 17608, progressStorage = 17738, killsRequired = 600},
['pirate marauder'] = {taskerStorage = 17608, progressStorage = 17738, killsRequired = 600},
['pirate cutthroat'] = {taskerStorage = 17608, progressStorage = 17738, killsRequired = 600},
['pirate ghost'] = {taskerStorage = 17608, progressStorage = 17738, killsRequired = 600},
['pirate buccaneer'] = {taskerStorage = 17608, progressStorage = 17738, killsRequired = 600},
['pirate corsair'] = {taskerStorage = 17608, progressStorage = 17738, killsRequired = 600},
['orc spearman'] = {taskerStorage = 17608, progressStorage = 17712, killsRequired = 300},
['orc shaman'] = {taskerStorage = 17608, progressStorage = 17712, killsRequired = 300},
['orc rider'] = {taskerStorage = 17608, progressStorage = 17712, killsRequired = 300},
['orc warrior'] = {taskerStorage = 17608, progressStorage = 17712, killsRequired = 300},
['orc berserker'] = {taskerStorage = 17608, progressStorage = 17712, killsRequired = 300},
['minotaur archer'] = {taskerStorage = 17608, progressStorage = 17713, killsRequired = 300},
['minotaur guard'] = {taskerStorage = 17608, progressStorage = 17713, killsRequired = 300},
['minotaur mage'] = {taskerStorage = 17608, progressStorage = 17713, killsRequired = 300},
['lizard templar'] = {taskerStorage = 17608, progressStorage = 17714, killsRequired = 300},
['lizard sentinel'] = {taskerStorage = 17608, progressStorage = 17714, killsRequired = 300},
['lizard snakecharmer'] = {taskerStorage = 17608, progressStorage = 17714, killsRequired = 300},
['dwarf soldier'] = {taskerStorage = 17608, progressStorage = 17715, killsRequired = 300},
['dwarf guard'] = {taskerStorage = 17608, progressStorage = 17715, killsRequired = 300},
['dwarf geomancer'] = {taskerStorage = 17608, progressStorage = 17715, killsRequired = 300},
['ghost'] = {taskerStorage = 17608, progressStorage = 17716, killsRequired = 200},
['demon skeleton'] = {taskerStorage = 17608, progressStorage = 17716, killsRequired = 200},
['vampire'] = {taskerStorage = 17608, progressStorage = 17716, killsRequired = 200},
['orc leader'] = {taskerStorage = 17608, progressStorage = 17717, killsRequired = 125},
['orc warlord'] = {taskerStorage = 17608, progressStorage = 17717, killsRequired = 125},
['hero'] = {taskerStorage = 17608, progressStorage = 17718, killsRequired = 150},
['necromancer'] = {taskerStorage = 17608, progressStorage = 17719, killsRequired = 300},
['priestess'] = {taskerStorage = 17608, progressStorage = 17719, killsRequired = 300},
['nightmare'] = {taskerStorage = 17608, progressStorage = 17720, killsRequired = 150},
['warlock'] = {taskerStorage = 17608, progressStorage = 17721, killsRequired = 300},
['demon'] = {taskerStorage = 17608, progressStorage = 17722, killsRequired = 6666},
-- Daniel Steelsoul
['troll'] = {taskerStorage = 17632, progressStorage = 17633, killsRequired = 100},
['goblin'] = {taskerStorage = 17632, progressStorage = 17634, killsRequired = 150},
['rotworm'] = {taskerStorage = 17632, progressStorage = 17635, killsRequired = 150},
['carrion worm'] = {taskerStorage = 17632, progressStorage = 17635, killsRequired = 150},
['cyclops'] = {taskerStorage = 17632, progressStorage = 17636, killsRequired = 150},
-- Young Vocation Tasks
['amazon'] = {taskerStorage = 17644, progressStorage = 17645, killsRequired = 50},
['minotaur'] = {taskerStorage = 17649, progressStorage = 17648, killsRequired = 50},
['orc'] = {taskerStorage = 17652, progressStorage = 17651, killsRequired = 50},
}
local maxPlayersInPartyShare = 10
function onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
if not creature:isMonster() or creature:getMaster() then
return true
end
if mostdamagekiller == nil then
return true
end
local player = mostdamagekiller
if not mostdamagekiller:isPlayer() then
local master = mostdamagekiller:getMaster()
if master and master:isPlayer() then
player = master
else
return true
end
end
local targetName = creature:getName():lower()
local task = tasks[targetName]
if task ~= nil then
local players
local party = player:getParty()
if party ~= nil and party:isSharedExperienceActive() then
players = party:getMembers() -- all members of the party
players[#players + 1] = party:getLeader() -- don't forget the leader
else
players = { player } -- no party? then just the player
end
for i, member in ipairs(players) do
if i <= maxPlayersInPartyShare then
local inProgressQuest = member:getStorageValue(task.taskerStorage)
if inProgressQuest == task.progressStorage then
local playerQuestKills = member:getStorageValue(task.progressStorage)
if playerQuestKills < task.killsRequired then
member:setStorageValue(task.progressStorage, playerQuestKills + 1)
member:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "[Task Tracker] You have killed " .. playerQuestKills + 1 .. "/" .. task.killsRequired .. " " .. targetName .. ".")
end
end
end
end
end
return true
end

View File

@@ -0,0 +1,326 @@
local fakePlayers = {
{x = 32864, y = 31997, z = 7},
{x = 32864, y = 31998, z = 7},
{x = 32865, y = 31999, z = 7},
{x = 32871, y = 31999, z = 7},
{x = 32872, y = 32000, z = 7},
{x = 32825, y = 32065, z = 7},
{x = 32828, y = 32065, z = 7},
{x = 32885, y = 32050, z = 7},
{x = 32885, y = 32049, z = 7},
{x = 32823, y = 31887, z = 7},
{x = 32691, y = 31716, z = 7},
{x = 32705, y = 31787, z = 7},
{x = 32716, y = 31928, z = 7},
{x = 32880, y = 31845, z = 7},
{x = 32879, y = 31845, z = 7},
{x = 32882, y = 31840, z = 7},
{x = 32655, y = 32109, z = 8},
{x = 32665, y = 32109, z = 8},
{x = 32254, y = 32019, z = 7},
{x = 32255, y = 32020, z = 7},
{x = 32245, y = 32021, z = 7},
{x = 32238, y = 32330, z = 7},
{x = 32238, y = 32331, z = 7},
{x = 32273, y = 32396, z = 7},
{x = 32465, y = 32315, z = 7},
{x = 32225, y = 31740, z = 7},
{x = 32230, y = 31739, z = 7},
{x = 32257, y = 31838, z = 7},
{x = 32258, y = 31840, z = 7},
{x = 32258, y = 31844, z = 7},
{x = 32260, y = 31846, z = 7},
{x = 32261, y = 31848, z = 7},
{x = 32231, y = 31701, z = 7},
{x = 32516, y = 31599, z = 7},
{x = 32486, y = 31590, z = 7},
{x = 32493, y = 31590, z = 7},
{x = 32503, y = 31670, z = 7},
{x = 32579, y = 31928, z = 0},
{x = 32596, y = 31922, z = 0},
{x = 32621, y = 31921, z = 1},
{x = 32651, y = 31942, z = 7},
{x = 32531, y = 32721, z = 7},
{x = 32531, y = 32720, z = 7},
{x = 32530, y = 32720, z = 7},
{x = 32537, y = 32813, z = 7},
{x = 32537, y = 32814, z = 7},
{x = 32537, y = 32759, z = 7},
{x = 32538, y = 32759, z = 7},
{x = 33275, y = 32829, z = 7},
{x = 33238, y = 32555, z = 7},
{x = 33237, y = 32555, z = 7},
{x = 33187, y = 32343, z = 7},
{x = 33187, y = 32342, z = 7},
{x = 33152, y = 32354, z = 7},
{x = 33154, y = 32354, z = 7},
{x = 33076, y = 32345, z = 7},
{x = 32655, y = 31648, z = 10},
{x = 32656, y = 31648, z = 10},
{x = 32657, y = 31648, z = 10},
{x = 33262, y = 31866, z = 7},
{x = 33263, y = 31866, z = 7},
{x = 33244, y = 31904, z = 7},
{x = 33245, y = 31903, z = 7},
{x = 33219, y = 31926, z = 7},
{x = 33298, y = 31839, z = 7},
{x = 33298, y = 31838, z = 7},
{x = 33358, y = 31692, z = 9},
{x = 33359, y = 31692, z = 9},
{x = 33360, y = 31692, z = 9},
{x = 33362, y = 31696, z = 9},
{x = 33366, y = 31696, z = 9},
{x = 33318, y = 31728, z = 7},
{x = 33318, y = 31729, z = 7},
{x = 33273, y = 31680, z = 7},
{x = 33169, y = 31737, z = 7},
{x = 33274, y = 31791, z = 6},
{x = 33321, y = 32419, z = 7},
{x = 33318, y = 32406, z = 7},
{x = 32372, y = 32840, z = 7},
{x = 32371, y = 32839, z = 7},
{x = 32369, y = 32838, z = 7},
{x = 32347, y = 32691, z = 7},
{x = 32348, y = 32692, z = 7},
{x = 32157, y = 32783, z = 7},
{x = 32225, y = 32880, z = 7},
{x = 32386, y = 32695, z = 7},
{x = 32314, y = 32830, z = 8},
{x = 32593, y = 31885, z = 12},
{x = 32593, y = 31884, z = 12},
{x = 32586, y = 31919, z = 10},
{x = 32547, y = 31921, z = 10},
{x = 32763, y = 31941, z = 7},
{x = 32763, y = 31942, z = 7},
{x = 32700, y = 31842, z = 7},
{x = 32700, y = 31841, z = 7},
{x = 32991, y = 32377, z = 7},
{x = 32314, y = 32282, z = 7},
{x = 32659, y = 31632, z = 15},
{x = 32660, y = 31632, z = 15},
{x = 32661, y = 31632, z = 15},
{x = 32663, y = 31632, z = 15},
{x = 32661, y = 31634, z = 15},
{x = 32714, y = 31649, z = 15},
{x = 32715, y = 31649, z = 15},
{x = 32716, y = 31649, z = 15},
{x = 32717, y = 31649, z = 15},
{x = 32577, y = 31601, z = 11},
{x = 32577, y = 31602, z = 11},
{x = 32577, y = 31603, z = 11},
{x = 32577, y = 31604, z = 11},
{x = 32577, y = 31605, z = 11},
{x = 32602, y = 31611, z = 11},
{x = 32601, y = 31611, z = 11},
{x = 32600, y = 31610, z = 11},
{x = 32599, y = 31610, z = 11},
{x = 32598, y = 31609, z = 11},
{x = 32598, y = 31608, z = 11},
{x = 32604, y = 31670, z = 7},
{x = 32605, y = 31670, z = 7},
{x = 32606, y = 31670, z = 7},
{x = 32607, y = 31670, z = 7},
{x = 32608, y = 31670, z = 7},
{x = 32609, y = 31670, z = 7},
{x = 32537, y = 31772, z = 4},
{x = 32537, y = 31772, z = 3},
{x = 32382, y = 32130, z = 10},
{x = 32410, y = 32123, z = 10},
{x = 32408, y = 32123, z = 10},
{x = 32445, y = 32213, z = 8},
{x = 32445, y = 32212, z = 8},
{x = 32444, y = 32210, z = 8},
{x = 32392, y = 31805, z = 8},
{x = 32127, y = 31660, z = 8},
{x = 32127, y = 31659, z = 8},
{x = 32187, y = 31623, z = 4},
{x = 32188, y = 31623, z = 4},
{x = 32189, y = 31623, z = 4},
{x = 32189, y = 31624, z = 4},
{x = 32187, y = 31625, z = 4},
{x = 32190, y = 31656, z = 7},
{x = 32030, y = 31691, z = 7},
{x = 32030, y = 31692, z = 7},
{x = 32030, y = 31693, z = 7},
{x = 31960, y = 31583, z = 7},
{x = 31960, y = 31584, z = 7},
{x = 31961, y = 31585, z = 7},
{x = 31961, y = 31582, z = 7},
{x = 32029, y = 31536, z = 10},
{x = 32258, y = 31641, z = 7},
{x = 32316, y = 31747, z = 2},
{x = 32317, y = 31747, z = 2},
{x = 32910, y = 32085, z = 5},
{x = 33021, y = 32046, z = 5},
{x = 32978, y = 32254, z = 7},
{x = 32977, y = 32254, z = 7},
{x = 32976, y = 32254, z = 7},
{x = 32975, y = 32254, z = 7},
{x = 32974, y = 32254, z = 7},
{x = 32950, y = 32271, z = 7},
{x = 32952, y = 32270, z = 7},
{x = 32951, y = 32270, z = 7},
{x = 32953, y = 32264, z = 7},
{x = 32383, y = 32852, z = 6},
{x = 32393, y = 32838, z = 0},
{x = 32393, y = 32839, z = 0},
{x = 32393, y = 32840, z = 0},
{x = 32572, y = 31875, z = 10},
{x = 32571, y = 31875, z = 10},
{x = 32724, y = 31975, z = 6},
{x = 32801, y = 31861, z = 6},
{x = 32800, y = 31862, z = 6},
{x = 32801, y = 31862, z = 6},
{x = 32801, y = 31863, z = 6},
{x = 32800, y = 31863, z = 6},
{x = 33227, y = 32389, z = 5},
{x = 33228, y = 32389, z = 5},
{x = 33329, y = 32171, z = 5},
{x = 33330, y = 32171, z = 5},
{x = 33305, y = 31991, z = 6},
{x = 33305, y = 31992, z = 6},
{x = 33311, y = 31990, z = 6},
{x = 33312, y = 31990, z = 6},
{x = 33361, y = 32048, z = 7},
{x = 33363, y = 32047, z = 7},
{x = 33364, y = 32045, z = 7},
{x = 33359, y = 32046, z = 7},
{x = 33331, y = 32056, z = 7},
{x = 33332, y = 32055, z = 7},
{x = 33335, y = 32054, z = 7},
{x = 33334, y = 32049, z = 7},
{x = 33313, y = 31946, z = 7},
{x = 33314, y = 31882, z = 7},
{x = 33280, y = 31842, z = 8},
{x = 33226, y = 32869, z = 7},
{x = 33204, y = 31909, z = 7},
{x = 33218, y = 31924, z = 7},
{x = 33220, y = 31924, z = 7}
}
local fakePlayerOutfits = {
[1] = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150}, -- female outfits
[2] = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146} -- male outfits
}
local fakePlayerRunes = {
[1] = { id = 3189, count = 3},
[2] = { id = 3152, count = 1},
[3] = { id = 3198, count = 5}
}
function onLogin(player)
local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!"
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. " Please choose your outfit."
player:sendOutfitWindow()
else
if loginStr ~= "" then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end
loginStr = string.format("Your last visit on " .. configManager.getString(configKeys.SERVER_NAME) .. ": %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
end
if not player:isPremium() then
local dayNow = tonumber(os.date("%d", os.time()))
local hourNow = tonumber(os.date("%H", os.time()))
if dayNow == 8 and hourNow == 20 then
player:addPremiumDays(5)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations " .. player:getName() .. " on starting your adventure at the " .. configManager.getString(configKeys.SERVER_NAME) .. "! 5 premium days have been added to your account!")
elseif dayNow == 8 then
player:addPremiumDays(2)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations " .. player:getName() .. " on starting your adventure at the " .. configManager.getString(configKeys.SERVER_NAME) .. "! 2 premium days have been added to your account!")
end
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
-- Stamina
nextUseStaminaTime[player.uid] = 0
-- Promotion
if player:getVocation():getId() ~= 0 and player:getVocation():getId() < 5 and player:getStorageValue(30018) == 1 then
player:setVocation(player:getVocation():getId() + 4)
end
-- Premium system
if player:isPremium() then
player:setStorageValue(43434, 1)
elseif player:getStorageValue(43434) == 1 then
player:setStorageValue(43434, 0)
end
-- FakePlayer
if player:isFakePlayer() then
local inFightCondition = Condition(CONDITION_INFIGHT)
inFightCondition:setParameter(CONDITION_PARAM_TICKS, 2000 * 60 * 1000)
player:addCondition(inFightCondition)
player:addManaSpent(2500)
if player:getLevel() <= 17 then
if player:getVocation():getId() == 2 then
player:addExperience(math.random(2500, 11000), false)
else
player:addExperience(math.random(9000, 11000), false)
end
end
if player:getItemCount(3578) <= 0 then
local randomFakePlayerPosition = math.random(1, #fakePlayers)
player:teleportTo(fakePlayers[randomFakePlayerPosition])
Game.sendMagicEffect(fakePlayers[randomFakePlayerPosition], 11)
table.remove(fakePlayers, randomFakePlayerPosition)
local container = Game.createItem(2854, 1)
container:addItem(3578, math.random(5, 15))
if math.random(5, 15) >= 10 then
container:addItem(3483, 1)
end
if math.random(5, 15) >= 5 then
container:addItem(3003, 1)
end
player:addItemEx(container, true, CONST_SLOT_BACKPACK)
if player:getVocation():getId() == 1 or player:getVocation():getId() == 2 or player:getVocation():getId() == 3 then
local backpackCount = math.random(1, 2)
local runeCount = math.random(5, 20) * backpackCount
for i=1,backpackCount do
local bp = Game.createItem(2854, 1)
for i=1,20 do
if runeCount <= 0 then
bp:addItem(3147, 1)
else
bp:addItem(fakePlayerRunes[player:getVocation():getId()].id, fakePlayerRunes[player:getVocation():getId()].count)
runeCount = runeCount - 1
end
end
player:addItemEx(bp, true, CONST_SLOT_BACKPACK)
end
end
end
if player:getStorageValue(17740) ~= 1 then
local fakeOutfitTypes = fakePlayerOutfits[player:getSex() + 1]
player:setOutfit({
lookType = fakeOutfitTypes[math.random(#fakeOutfitTypes)],
lookHead = math.random(0, 132),
lookBody = math.random(0, 132),
lookLegs = math.random(0, 132),
lookFeet = math.random(0, 132)
})
player:setStorageValue(17740, 1)
end
end
-- Events
player:registerEvent("PlayerDeath")
player:registerEvent("kills")
player:registerEvent("PlayerLogout")
player:registerEvent("FirstItems")
player:registerEvent("RegenerateStamina")
return true
end

View File

@@ -0,0 +1,7 @@
function onLogout(player)
local playerId = player:getId()
if nextUseStaminaTime[playerId] then
nextUseStaminaTime[playerId] = nil
end
return true
end

View File

@@ -0,0 +1,76 @@
function onLogin(player)
local lastLogout = player:getLastLogout()
local offlineTime = lastLogout ~= 0 and math.min(os.time() - lastLogout, 86400 * 21) or 0
local offlineTrainingSkill = player:getOfflineTrainingSkill()
if offlineTrainingSkill == -1 then
player:addOfflineTrainingTime(offlineTime * 1000)
return true
end
player:setOfflineTrainingSkill(-1)
if offlineTime < 600 then
player:setBankBalance(player:getBankBalance() + 1000)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be logged out for more than 10 minutes to start offline training. Your 1000 gold coins entree fee were returned to your bank account.")
return true
end
local trainingTime = math.max(0, math.min(offlineTime, math.min(43200 / 2, player:getOfflineTrainingTime() / 1000)))
player:removeOfflineTrainingTime(trainingTime * 1000)
local remainder = offlineTime - trainingTime
if remainder > 0 then
player:addOfflineTrainingTime(remainder * 1000)
end
if trainingTime < 60 then
return true
end
local text = "During your absence you trained for"
local hours = math.floor(trainingTime / 3600)
if hours > 1 then
text = string.format("%s %d hours", text, hours)
elseif hours == 1 then
text = string.format("%s 1 hour", text)
end
local minutes = math.floor((trainingTime % 3600) / 60)
if minutes ~= 0 then
if hours ~= 0 then
text = string.format("%s and", text)
end
if minutes > 1 then
text = string.format("%s %d minutes", text, minutes)
else
text = string.format("%s 1 minute", text)
end
end
text = string.format("%s.", text)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, text)
local vocation = player:getVocation()
local promotion = vocation:getPromotion()
local topVocation = not promotion and vocation or promotion
local updateSkills = false
if table.contains({SKILL_CLUB, SKILL_SWORD, SKILL_AXE, SKILL_DISTANCE}, offlineTrainingSkill) then
local modifier = topVocation:getAttackSpeed() / 1000
updateSkills = player:addOfflineTrainingTries(offlineTrainingSkill, (trainingTime / modifier) / (offlineTrainingSkill == SKILL_DISTANCE and 8 or 4))
elseif offlineTrainingSkill == SKILL_MAGLEVEL then
local gainTicks = topVocation:getManaGainTicks() * 4
if gainTicks == 0 then
gainTicks = 1
end
updateSkills = player:addOfflineTrainingTries(SKILL_MAGLEVEL, trainingTime * (vocation:getManaGainAmount() / gainTicks))
end
if updateSkills then
player:addOfflineTrainingTries(SKILL_SHIELD, trainingTime / 8)
end
return true
end

View File

@@ -0,0 +1,85 @@
local deathListEnabled = true
local maxDeathRecords = 50
function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
local playerId = player:getId()
if nextUseStaminaTime[playerId] then
nextUseStaminaTime[playerId] = nil
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are dead.")
-- restart blessings values
player:setStorageValue(101,0)
player:setStorageValue(102,0)
player:setStorageValue(103,0)
player:setStorageValue(104,0)
player:setStorageValue(105,0)
if not deathListEnabled then
return
end
local byPlayer = false
local killerName
if killer ~= nil then
if killer:isPlayer() then
byPlayer = true
else
local master = killer:getMaster()
if master and master ~= killer and master:isPlayer() then
killer = master
byPlayer = true
end
end
killerName = killer:getName()
else
killerName = "field item"
end
local byPlayerMostDamage = 0
local mostDamageKillerName
if mostDamageKiller ~= nil then
if mostDamageKiller:isPlayer() then
byPlayerMostDamage = 1
else
local master = mostDamageKiller:getMaster()
if master and master ~= mostDamageKiller and master:isPlayer() then
mostDamageKiller = master
byPlayerMostDamage = 1
end
end
mostDamageName = mostDamageKiller:getName()
else
mostDamageName = "field item"
end
local playerGuid = player:getGuid()
db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES (" .. playerGuid .. ", " .. os.time() .. ", " .. player:getLevel() .. ", " .. db.escapeString(killerName) .. ", " .. (byPlayer and 1 or 0) .. ", " .. db.escapeString(mostDamageName) .. ", " .. byPlayerMostDamage .. ", " .. (unjustified and 1 or 0) .. ", " .. (mostDamageUnjustified and 1 or 0) .. ")")
local resultId = db.storeQuery("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. playerGuid)
local deathRecords = 0
local tmpResultId = resultId
while tmpResultId ~= false do
tmpResultId = result.next(resultId)
deathRecords = deathRecords + 1
end
if resultId ~= false then
result.free(resultId)
end
local limit = deathRecords - maxDeathRecords
if limit > 0 then
db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit)
end
if not byPlayer then
return
end
local warId = guildwars:isInWar(killer, player)
if warId ~= 0 then
guildwars:processKill(warId, killer, player)
end
end

View File

@@ -0,0 +1,27 @@
function onLogin(player)
if not configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
return true
end
local lastLogout = player:getLastLogout()
local offlineTime = lastLogout ~= 0 and math.min(os.time() - lastLogout, 86400 * 21) or 0
offlineTime = offlineTime - 600
if offlineTime < 180 then
return true
end
local staminaMinutes = player:getStamina()
local maxNormalStaminaRegen = 3240 - math.min(3240, staminaMinutes)
local regainStaminaMinutes = offlineTime / 180
if regainStaminaMinutes > maxNormalStaminaRegen then
local happyHourStaminaRegen = (offlineTime - (maxNormalStaminaRegen * 180)) / 600
staminaMinutes = math.min(3360, math.max(3240, staminaMinutes) + happyHourStaminaRegen)
else
staminaMinutes = staminaMinutes + regainStaminaMinutes
end
player:setStamina(staminaMinutes)
return true
end

View File

@@ -0,0 +1,39 @@
-- Sync outfits that player own with Znote AAC
-- So its possible to see which full sets player
-- has in characterprofile.php
znote_outfit_list = {
{ -- Female (girl) outfits
136,137,138,139,140,141,142,147,148,
149,150,155,156,157,158,252,269,270,
279,288,324,329,336,366,431,433,464,
466,471,513,514,542,575,578,618,620,
632,635,636,664,666,683,694,696,698,
724,732,745,749,759,845,852,874,885,
900
},
{ -- Male (boy) outfits
128,129,130,131,132,133,134,143,144,
145,146,151,152,153,154,251,268,273,
278,289,325,328,335,367,430,432,463,
465,472,512,516,541,574,577,610,619,
633,634,637,665,667,684,695,697,699,
725,733,746,750,760,846,853,873,884,
899
}
}
function onLogin(player)
-- storage_value + 1000 storages (highest outfit id) must not be used in other script.
-- Must be identical to Znote AAC config.php: $config['EQ_shower'] -> storage_value
local storage_value = 10000
-- Loop through outfits
for _, outfit in pairs(znote_outfit_list[player:getSex()+1]) do
if player:hasOutfit(outfit,3) then
if player:getStorageValue(storage_value + outfit) ~= 3 then
player:setStorageValue(storage_value + outfit, 3)
end
end
end
return true
end