mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 06:34:55 +02:00
Resolve "Merge the best from 7.40 branch"
This commit is contained in:
30
data/globalevents/scripts/powergamers.lua
Normal file
30
data/globalevents/scripts/powergamers.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
local function getEternalStorage(key, parser)
|
||||
local value = result.getDataString(db.storeQuery("SELECT `value` FROM `znote_global_storage` WHERE `key` = ".. key .. ";"), "value")
|
||||
if not value then
|
||||
if parser then
|
||||
return false
|
||||
else
|
||||
return -1
|
||||
end
|
||||
end
|
||||
return tonumber(value) or value
|
||||
end
|
||||
|
||||
local function setEternalStorage(key, value)
|
||||
if getEternalStorage(key, true) then
|
||||
db.query("UPDATE `znote_global_storage` SET `value` = '".. value .. "' WHERE `key` = ".. key .. ";")
|
||||
else
|
||||
db.query("INSERT INTO `znote_global_storage` (`key`, `value`) VALUES (".. key ..", ".. value ..");")
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function onThink(interval, lastExecution, thinkInterval)
|
||||
if tonumber(os.date("%d")) ~= getEternalStorage(23856) then
|
||||
setEternalStorage(23856, (tonumber(os.date("%d"))))
|
||||
db.query("UPDATE `znote_players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
|
||||
db.query("UPDATE `znote_players` `z` INNER JOIN `players` `p` ON `p`.`id`=`z`.`player_id` SET `z`.`exphist7`=`z`.`exphist6`, `z`.`exphist6`=`z`.`exphist5`, `z`.`exphist5`=`z`.`exphist4`, `z`.`exphist4`=`z`.`exphist3`, `z`.`exphist3`=`z`.`exphist2`, `z`.`exphist2`=`z`.`exphist1`, `z`.`exphist1`=`p`.`experience`-`z`.`exphist_lastexp`, `z`.`exphist_lastexp`=`p`.`experience`;")
|
||||
end
|
||||
db.query("UPDATE `znote_players` SET `onlinetimetoday` = `onlinetimetoday` + 60, `onlinetimeall` = `onlinetimeall` + 60 WHERE `player_id` IN (SELECT `player_id` FROM `players_online` WHERE `players_online`.`player_id` = `znote_players`.`player_id`)")
|
||||
return true
|
||||
end
|
@@ -1,3 +1,108 @@
|
||||
local monsterOfTheDay = {
|
||||
{ id = 8430, monster = 'Crocodile' },
|
||||
{ id = 8431, monster = 'Tarantula' },
|
||||
{ id = 8432, monster = 'Carniphila' },
|
||||
{ id = 8433, monster = 'Merlkin' },
|
||||
{ id = 8434, monster = 'Kongra' },
|
||||
{ id = 8435, monster = 'Sibang' },
|
||||
{ id = 8436, monster = 'Thornback Tortoise' },
|
||||
{ id = 8437, monster = 'Gargoyle' },
|
||||
{ id = 8438, monster = 'Quara Constrictor Scout' },
|
||||
{ id = 8439, monster = 'Quara Hydromancer Scout' },
|
||||
{ id = 8440, monster = 'Quara Mantassin Scout' },
|
||||
{ id = 8441, monster = 'Quara Pincher Scout' },
|
||||
{ id = 8442, monster = 'Quara Predator Scout' },
|
||||
{ id = 8443, monster = 'Ancient Scarab' },
|
||||
{ id = 8444, monster = 'Wyvern' },
|
||||
{ id = 8445, monster = 'Bonebeast' },
|
||||
{ id = 8446, monster = 'Dragon' },
|
||||
{ id = 8447, monster = 'Quara Constrictor' },
|
||||
{ id = 8448, monster = 'Quara Hydromancer' },
|
||||
{ id = 8449, monster = 'Quara Mantassin' },
|
||||
{ id = 8450, monster = 'Quara Pincher' },
|
||||
{ id = 8451, monster = 'Quara Predator' },
|
||||
{ id = 8452, monster = 'Giant Spider' },
|
||||
{ id = 8453, monster = 'Banshee' },
|
||||
{ id = 8454, monster = 'Lich' },
|
||||
{ id = 8455, monster = 'Acolyte of The Cult' },
|
||||
{ id = 8456, monster = 'Adept of The Cult' },
|
||||
{ id = 8457, monster = 'Enlightened of The Cult' },
|
||||
{ id = 8458, monster = 'Novice of The Cult' },
|
||||
{ id = 8459, monster = 'Hydra' },
|
||||
{ id = 8460, monster = 'Serpent Spawn' },
|
||||
{ id = 8461, monster = 'Behemoth' },
|
||||
{ id = 8462, monster = 'Dragon Lord' },
|
||||
{ id = 8463, monster = 'Hand of Cursed Fate' },
|
||||
{ id = 8464, monster = 'Juggernaut' },
|
||||
{ id = 8465, monster = 'Frost Troll' },
|
||||
{ id = 8466, monster = 'Swamp Troll' },
|
||||
{ id = 8467, monster = 'Rat' },
|
||||
{ id = 8468, monster = 'Cave Rat' },
|
||||
{ id = 8469, monster = 'Wolf' },
|
||||
{ id = 8470, monster = 'Winter Wolf' },
|
||||
{ id = 8471, monster = 'Wasp' },
|
||||
{ id = 8472, monster = 'Larva' },
|
||||
{ id = 8473, monster = 'Dwarf' },
|
||||
{ id = 8474, monster = 'Skeleton' },
|
||||
{ id = 8475, monster = 'Ghoul' },
|
||||
{ id = 8476, monster = 'Elf' },
|
||||
{ id = 8477, monster = 'Elf Scout' },
|
||||
{ id = 8478, monster = 'Elf Arcanist' },
|
||||
{ id = 8479, monster = 'Bug' },
|
||||
{ id = 8480, monster = 'Smuggler' },
|
||||
{ id = 8481, monster = 'Wild Warrior' },
|
||||
{ id = 8482, monster = 'Bandit' },
|
||||
{ id = 8483, monster = 'Hyaena' },
|
||||
{ id = 8484, monster = 'Lion' },
|
||||
{ id = 8485, monster = 'Bear' },
|
||||
{ id = 8486, monster = 'Slime' },
|
||||
{ id = 8487, monster = 'Beholder' },
|
||||
{ id = 8488, monster = 'Elder Beholder' },
|
||||
{ id = 8489, monster = 'Green Djinn' },
|
||||
{ id = 8490, monster = 'Blue Djinn' },
|
||||
{ id = 8491, monster = 'Marid' },
|
||||
{ id = 8492, monster = 'Efreet' },
|
||||
{ id = 8493, monster = 'Pirate Skeleton' },
|
||||
{ id = 8494, monster = 'Pirate Marauder' },
|
||||
{ id = 8495, monster = 'Pirate Cutthroat' },
|
||||
{ id = 8496, monster = 'Pirate Ghost' },
|
||||
{ id = 8497, monster = 'Pirate Buccaneer' },
|
||||
{ id = 8498, monster = 'Pirate Corsair' },
|
||||
{ id = 8499, monster = 'Orc Spearman' },
|
||||
{ id = 8500, monster = 'Orc Shaman' },
|
||||
{ id = 8501, monster = 'Orc Rider' },
|
||||
{ id = 8502, monster = 'Orc Warrior' },
|
||||
{ id = 8503, monster = 'Orc Berserker' },
|
||||
{ id = 8504, monster = 'Minotaur Archer' },
|
||||
{ id = 8505, monster = 'Minotaur Guard' },
|
||||
{ id = 8506, monster = 'Minotaur Mage' },
|
||||
{ id = 8507, monster = 'Lizard Templar' },
|
||||
{ id = 8508, monster = 'Lizard Sentinel' },
|
||||
{ id = 8509, monster = 'Lizard Snakecharmer' },
|
||||
{ id = 8510, monster = 'Dwarf Soldier' },
|
||||
{ id = 8511, monster = 'Dwarf Guard' },
|
||||
{ id = 8512, monster = 'Dwarf Geomancer' },
|
||||
{ id = 8513, monster = 'Ghost' },
|
||||
{ id = 8514, monster = 'Demon Skeleton' },
|
||||
{ id = 8515, monster = 'Vampire' },
|
||||
{ id = 8516, monster = 'Orc Leader' },
|
||||
{ id = 8517, monster = 'Orc Warlord' },
|
||||
{ id = 8518, monster = 'Hero' },
|
||||
{ id = 8519, monster = 'Necromancer' },
|
||||
{ id = 8520, monster = 'Priestess' },
|
||||
{ id = 8521, monster = 'Nightmare' },
|
||||
{ id = 8522, monster = 'Warlock' },
|
||||
{ id = 8523, monster = 'Demon' },
|
||||
{ id = 8524, monster = 'Troll' },
|
||||
{ id = 8525, monster = 'Goblin' },
|
||||
{ id = 8526, monster = 'Rotworm' },
|
||||
{ id = 8527, monster = 'Carrion Worm' },
|
||||
{ id = 8528, monster = 'Cyclops' },
|
||||
{ id = 8529, monster = 'Amazon' },
|
||||
{ id = 8530, monster = 'Minotaur' },
|
||||
{ id = 8531, monster = 'Orc' }
|
||||
}
|
||||
|
||||
local function spawnRashid()
|
||||
local rashidSpawns = {
|
||||
['Monday'] = Position(32349, 32231, 6),
|
||||
@@ -91,5 +196,8 @@ function onStartup()
|
||||
end
|
||||
|
||||
spawnRashid()
|
||||
--addEvent(function () Game.setGameState(GAME_STATE_CLOSED) end, 5000)
|
||||
setGlobalStorageValue(17657, 0) -- reset POI levers
|
||||
setGlobalStorageValue(8420, monsterOfTheDay[math.random(1, #monsterOfTheDay)].id)
|
||||
setGlobalStorageValue(8421, math.random(10, 25))
|
||||
end
|
||||
|
Reference in New Issue
Block a user