Various optimization to config.php and LUA scripts

* Update config.php
* spaces to tabs and new line at eof
* updated playerdeath.lua to match latest one from master
This commit is contained in:
Evil Puncker
2020-05-29 16:40:28 -03:00
committed by GitHub
parent a78d26b103
commit e056898f31
16 changed files with 404 additions and 397 deletions

View File

@@ -1,6 +1,6 @@
function onLogin(cid)
local storage = 30055 -- storage value
local sorcItems = {
2460, -- Brass helmet
2465, -- Brass armor
@@ -39,39 +39,39 @@ function onLogin(cid)
1988, -- Brown backpack
2050 -- torch
}
if getPlayerStorageValue(cid, storage) == -1 then
setPlayerStorageValue(cid, storage, 1)
if getPlayerVocation(cid) == 1 then
-- Sorcerer
for i = 1, table.getn(sorcItems), 1 do
doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
doPlayerAddItem(cid, sorcItems[i], 1, false)
end
elseif getPlayerVocation(cid) == 2 then
-- Druid
for i = 1, table.getn(druidItems), 1 do
doPlayerAddItem(cid, druidItems[i], 1, FALSE)
doPlayerAddItem(cid, druidItems[i], 1, false)
end
elseif getPlayerVocation(cid) == 3 then
-- Paladin
for i = 1, table.getn(pallyItems), 1 do
doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
doPlayerAddItem(cid, pallyItems[i], 1, false)
end
-- 8 arrows
doPlayerAddItem(cid, 2544, 8, FALSE)
doPlayerAddItem(cid, 2544, 8, false)
elseif getPlayerVocation(cid) == 4 then
-- Knight
for i = 1, table.getn(kinaItems), 1 do
doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
doPlayerAddItem(cid, kinaItems[i], 1, false)
end
end
-- Common for all
doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
doPlayerAddItem(cid, 2674, 5, false) -- 5 apples
doPlayerAddItem(cid, 2120, 1, false) -- 1 rope
end
return true
end

View File

@@ -2,11 +2,11 @@
function onSay(cid, words, param)
local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
local cooldown = 15 -- in seconds.
if getPlayerStorageValue(cid, storage) <= os.time() then
setPlayerStorageValue(cid, storage, os.time() + cooldown)
local accid = getAccountNumberByPlayerName(getCreatureName(cid))
local type_desc = {
"itemids",
"pending premium (skip)",
@@ -34,17 +34,17 @@ function onSay(cid, words, param)
description = type_desc[q_type]
end
print("Processing type "..q_type..": ".. description)
-- ORDER TYPE 1 (Regular item shop products)
if q_type == 1 then
served = true
-- Get wheight
-- Get weight
local playerCap = getPlayerFreeCap(cid)
local itemweight = getItemWeight(q_itemid, q_count)
if playerCap >= itemweight then
db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
doPlayerAddItem(cid, q_itemid, q_count)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemName(q_itemid).."(s)!")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have received ".. q_count .." "..getItemName(q_itemid).."(s)!")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP!")
end
@@ -77,7 +77,7 @@ function onSay(cid, words, param)
-- ORDER TYPE 6 (Mounts)
-- Not supported on TFS 0.2
-- Add custom order types here
-- Type 1 is for itemids (Already coded here)
-- Type 2 is for premium (Coded on web)