mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-30 03:09:22 +02:00
Converted tfs 1.0 scripts to meta, removed some spaces from config and fixed a typo
This commit is contained in:
parent
513cb4ded0
commit
09b618b67b
@ -1,77 +1,72 @@
|
|||||||
|
-- With Rookgaard
|
||||||
|
|
||||||
|
--[[
|
||||||
|
local firstItems = {2050, 2382}
|
||||||
|
|
||||||
function onLogin(cid)
|
function onLogin(cid)
|
||||||
local storage = 30055 -- storage value
|
local player = Player(cid)
|
||||||
|
if player:getLastLoginSaved() <= 0 then
|
||||||
local sorcItems = {
|
for i = 1, #firstItems do
|
||||||
2460, -- Brass helmet
|
player:addItem(firstItems[i], 1)
|
||||||
2465, -- Brass armor
|
|
||||||
2190, -- Wand of vortex
|
|
||||||
2511, -- Brass shield
|
|
||||||
2478, -- Brass legs
|
|
||||||
2643, -- Leather boots
|
|
||||||
1988, -- Brown backpack
|
|
||||||
2050 -- torch
|
|
||||||
}
|
|
||||||
local druidItems = {
|
|
||||||
2460, -- Brass helmet
|
|
||||||
2465, -- Brass armor
|
|
||||||
2511, -- Brass shield
|
|
||||||
2182, -- Snakebite rod
|
|
||||||
2478, -- Brass legs
|
|
||||||
2643, -- Leather boots
|
|
||||||
1988, -- Brown backpack
|
|
||||||
2050 -- torch
|
|
||||||
}
|
|
||||||
local pallyItems = {
|
|
||||||
2460, -- Brass helmet
|
|
||||||
2465, -- Brass armor
|
|
||||||
2456, -- Bow
|
|
||||||
2478, -- Brass legs
|
|
||||||
2643, -- Leather boots
|
|
||||||
1988, -- Brown backpack
|
|
||||||
}
|
|
||||||
local kinaItems = {
|
|
||||||
2460, -- Brass helmet
|
|
||||||
2465, -- Brass armor
|
|
||||||
2511, -- Brass shield
|
|
||||||
2412, -- Katana
|
|
||||||
2478, -- Brass legs
|
|
||||||
2643, -- Leather boots
|
|
||||||
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)
|
|
||||||
end
|
end
|
||||||
|
player:addItem(player:getSex() == 0 and 2651 or 2650, 1)
|
||||||
elseif getPlayerVocation(cid) == 2 then
|
player:addItem(1987, 1)
|
||||||
-- Druid
|
player:addItem(2674, 1)
|
||||||
for i = 1, table.getn(druidItems), 1 do
|
end
|
||||||
doPlayerAddItem(cid, druidItems[i], 1, FALSE)
|
return true
|
||||||
end
|
end
|
||||||
|
]]--
|
||||||
elseif getPlayerVocation(cid) == 3 then
|
|
||||||
-- Paladin
|
-- Without Rookgaard
|
||||||
for i = 1, table.getn(pallyItems), 1 do
|
local config = {
|
||||||
doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
|
[1] = {
|
||||||
end
|
--equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
|
||||||
-- 8 arrows
|
items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
|
||||||
doPlayerAddItem(cid, 2544, 8, FALSE)
|
--container rope, shovel, mana potion
|
||||||
|
container = {{2120, 1}, {2554, 1}, {7620, 1}}
|
||||||
elseif getPlayerVocation(cid) == 4 then
|
},
|
||||||
-- Knight
|
[2] = {
|
||||||
for i = 1, table.getn(kinaItems), 1 do
|
--equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
|
||||||
doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
|
items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
|
||||||
end
|
--container rope, shovel, mana potion
|
||||||
end
|
container = {{2120, 1}, {2554, 1}, {7620, 1}}
|
||||||
|
},
|
||||||
-- Common for all
|
[3] = {
|
||||||
doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
|
--equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
|
||||||
doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
|
items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
|
||||||
|
--container rope, shovel, health potion, bow, 50 arrow
|
||||||
|
container = {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}}
|
||||||
|
},
|
||||||
|
[4] = {
|
||||||
|
--equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
|
||||||
|
items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
|
||||||
|
--container jagged sword, daramian mace, rope, shovel, health potion
|
||||||
|
container = {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLogin(cid)
|
||||||
|
local player = Player(cid)
|
||||||
|
local targetVocation = config[player:getVocation():getId()]
|
||||||
|
if not targetVocation then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
if player:getLastLoginSaved() ~= 0 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 1, #targetVocation.items do
|
||||||
|
player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
|
||||||
|
end
|
||||||
|
|
||||||
|
local backpack = player:addItem(1988)
|
||||||
|
if not backpack then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 1, #targetVocation.container do
|
||||||
|
backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -86,7 +86,7 @@ function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjust
|
|||||||
end
|
end
|
||||||
|
|
||||||
if guildKills1 >= fragLimit or guildKills2 >= fragLimit then
|
if guildKills1 >= fragLimit or guildKills2 >= fragLimit then
|
||||||
broadcastMessage(string.format("%s has just won the war against %s.", killerGuild:getName(), playerGuild:getName()), MESSAGE_EVENT_ADVANCE)
|
Game.broadcastMessage(string.format("%s has just won the war against %s.", killerGuild:getName(), playerGuild:getName()), MESSAGE_EVENT_ADVANCE)
|
||||||
db.query("UPDATE `guild_wars` SET `status` = 4, `ended` = " .. os.time() .. " WHERE `status` = 1 AND `id` = " .. warId)
|
db.query("UPDATE `guild_wars` SET `status` = 4, `ended` = " .. os.time() .. " WHERE `status` = 1 AND `id` = " .. warId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
function onThink(interval, lastExecution, thinkInterval)
|
function onThink(interval, lastExecution, thinkInterval)
|
||||||
if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23856)) then
|
if tonumber(os.date("%d")) ~= Game.getStorageValue(23856) then
|
||||||
setGlobalStorageValue(23856, (tonumber(os.date("%d"))))
|
Game.setStorageValue(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` 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`;")
|
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
|
end
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
-- <talkaction words="!report" separator=" " script="adminreport.lua"/>
|
-- <talkaction words="!report" separator=" " script="adminreport.lua"/>
|
||||||
-- Coded by Dark ShaoOz, modified by Znote
|
-- Coded by Dark ShaoOz, modified by Znote
|
||||||
function onSay(cid, words, param, channel)
|
function onSay(cid, words, param, channel)
|
||||||
local storage = 6708 -- (You can change the storage if its already in use)
|
local player = Player(cid)
|
||||||
local delaytime = 30 -- (Exhaust In Seconds.)
|
local storage = 6708 -- You can change the storage if its already in use
|
||||||
local x = getPlayerPosition(cid).x -- (Do not edit this.)
|
local delaytime = 30 -- Exhaust In Seconds.
|
||||||
local y = getPlayerPosition(cid).y -- (Do not edit this.)
|
if param == '' then
|
||||||
local z = getPlayerPosition(cid).z -- (Do not edit this.)
|
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Command param required.")
|
||||||
if(param == '') then
|
|
||||||
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command param required.")
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if (getPlayerStorageValue(cid, storage) <= os.time()) then
|
if player:getStorageValue(storage) <= os.time() then
|
||||||
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
|
player:sendTextMessage(MESSAGE_INFO_DESCR, "Your report has been received successfully!")
|
||||||
db.query("INSERT INTO `znote_player_reports` (`id` ,`name` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`)VALUES (NULL , '" .. getPlayerName(cid) .. "', '" .. x .. "', '" .. y .. "', '" .. z .. "', " .. db.escapeString(param) .. ", '" .. os.time() .. "')")
|
db.query("INSERT INTO `znote_player_reports` (`id` ,`name` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`)VALUES (NULL , '" .. player:getName() .. "', '" .. player:getPosition().x .. "', '" .. player:getPosition().y .. "', '" .. player:getPosition().z .. "', " .. db.escapeString(param) .. ", '" .. os.time() .. "')")
|
||||||
setPlayerStorageValue(cid,storage,os.time()+delaytime)
|
player:setStorageValue(storage, os.time() + delaytime)
|
||||||
else
|
else
|
||||||
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have to wait "..getPlayerStorageValue(cid, storage) - os.time().." seconds to report again.")
|
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have to wait " .. player:getStorageValue(storage) - os.time() .. " seconds to report again.")
|
||||||
end
|
end
|
||||||
return TRUE
|
return true
|
||||||
end
|
end
|
@ -2,13 +2,13 @@
|
|||||||
function onSay(cid, words, param)
|
function onSay(cid, words, param)
|
||||||
local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
|
local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
|
||||||
local cooldown = 15 -- in seconds.
|
local cooldown = 15 -- in seconds.
|
||||||
|
local player = Player(cid)
|
||||||
|
|
||||||
if getPlayerStorageValue(cid, storage) <= os.time() then
|
if player:getStorageValue(storage) <= os.time() then
|
||||||
setPlayerStorageValue(cid, storage, os.time() + cooldown)
|
player:setStorageValue(storage, os.time() + cooldown)
|
||||||
local accid = getAccountNumberByPlayerName(getCreatureName(cid))
|
|
||||||
|
|
||||||
-- Create the query
|
-- Create the query
|
||||||
local orderQuery = db.storeQuery("SELECT `id`, `type`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. accid .. " LIMIT 1;")
|
local orderQuery = db.storeQuery("SELECT `id`, `type`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. player:getAccountId() .. " LIMIT 1;")
|
||||||
|
|
||||||
-- Detect if we got any results
|
-- Detect if we got any results
|
||||||
if orderQuery ~= false then
|
if orderQuery ~= false then
|
||||||
@ -22,14 +22,12 @@ function onSay(cid, words, param)
|
|||||||
-- ORDER TYPE 1 (Regular item shop products)
|
-- ORDER TYPE 1 (Regular item shop products)
|
||||||
if q_type == 1 then
|
if q_type == 1 then
|
||||||
-- Get wheight
|
-- Get wheight
|
||||||
local playerCap = getPlayerFreeCap(cid)
|
if player:getFreeCapacity() >= ItemType(q_itemid):getWeight(q_count) then
|
||||||
local itemweight = getItemWeight(q_itemid, q_count)
|
|
||||||
if playerCap >= itemweight then
|
|
||||||
db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
|
db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
|
||||||
doPlayerAddItem(cid, q_itemid, q_count)
|
player:addItem(q_itemid, q_count)
|
||||||
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemName(q_itemid).."(s)!")
|
player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received " .. q_count .. " x " .. ItemType(q_itemid):getName() .. "!")
|
||||||
else
|
else
|
||||||
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP!")
|
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Need more CAP!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Add custom order types here
|
-- Add custom order types here
|
||||||
@ -39,11 +37,10 @@ function onSay(cid, words, param)
|
|||||||
-- if q_type == 4 then
|
-- if q_type == 4 then
|
||||||
-- end
|
-- end
|
||||||
else
|
else
|
||||||
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no orders.")
|
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have no orders.")
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every "..cooldown.." seconds. Remaining cooldown: ".. getPlayerStorageValue(cid, storage) - os.time())
|
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every " .. cooldown .. " seconds. Remaining cooldown: " .. player:getStorageValue(storage) - os.time())
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
30
config.php
30
config.php
File diff suppressed because one or more lines are too long
@ -123,7 +123,7 @@ CREATE TABLE IF NOT EXISTS `znote_shop` (
|
|||||||
`type` int(11) NOT NULL,
|
`type` int(11) NOT NULL,
|
||||||
`itemid` int(11) DEFAULT NULL,
|
`itemid` int(11) DEFAULT NULL,
|
||||||
`count` int(11) NOT NULL DEFAULT '1',
|
`count` int(11) NOT NULL DEFAULT '1',
|
||||||
`describtion` varchar(255) NOT NULL,
|
`description` varchar(255) NOT NULL,
|
||||||
`points` int(11) NOT NULL DEFAULT '10',
|
`points` int(11) NOT NULL DEFAULT '10',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||||
|
@ -9,7 +9,7 @@ if ($logged_in === true) {
|
|||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
Image URL:<br /><input type="text" name="image" size="70"><br />
|
Image URL:<br /><input type="text" name="image" size="70"><br />
|
||||||
Image Title:<br /><input type="text" name="title" size="70"><br />
|
Image Title:<br /><input type="text" name="title" size="70"><br />
|
||||||
Image Describtion:<br /><textarea name="desc" cols="55" rows="15"></textarea><br />
|
Image Description:<br /><textarea name="desc" cols="55" rows="15"></textarea><br />
|
||||||
<input type="submit" name="Submit" value="Post Image Article">
|
<input type="submit" name="Submit" value="Post Image Article">
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
@ -101,5 +101,5 @@ echo $url;
|
|||||||
$url = explode("!", $url);
|
$url = explode("!", $url);
|
||||||
<a href="<?php echo 'http://'. $url[0] .'.imgland.net/'. $url[1] .'.'. $url[2]; ?>"><img src="<?php echo 'http://'. $url[0] .'.imgland.net/'. $url[1] .'.'. $url[2]; ?>" width="650"/></a>
|
<a href="<?php echo 'http://'. $url[0] .'.imgland.net/'. $url[1] .'.'. $url[2]; ?>"><img src="<?php echo 'http://'. $url[0] .'.imgland.net/'. $url[1] .'.'. $url[2]; ?>" width="650"/></a>
|
||||||
echo time();
|
echo time();
|
||||||
//insertImage(2, "Yaay!", "Super describtion!", "1!pxpmul!jpg");
|
//insertImage(2, "Yaay!", "Super description!", "1!pxpmul!jpg");
|
||||||
*/?>
|
*/?>
|
4
shop.php
4
shop.php
@ -95,7 +95,7 @@ if ($config['shop_auction']['characterAuction']) {
|
|||||||
<?php
|
<?php
|
||||||
foreach ($shop_list as $key => $offers) {
|
foreach ($shop_list as $key => $offers) {
|
||||||
echo '<tr class="special">';
|
echo '<tr class="special">';
|
||||||
echo '<td>'. $offers['describtion'] .'</td>';
|
echo '<td>'. $offers['description'] .'</td>';
|
||||||
if ($config['shop']['showImage']) echo '<td><img src="http://'. $config['shop']['imageServer'] .'/'. $offers['itemid'] .'.'. $config['shop']['imageType'] .'" alt="img"></td>';
|
if ($config['shop']['showImage']) echo '<td><img src="http://'. $config['shop']['imageServer'] .'/'. $offers['itemid'] .'.'. $config['shop']['imageType'] .'" alt="img"></td>';
|
||||||
if ($offers['type'] == 2) echo '<td>'. $offers['count'] .' Days</td>';
|
if ($offers['type'] == 2) echo '<td>'. $offers['count'] .' Days</td>';
|
||||||
else if ($offers['type'] == 3 && $offers['count'] == 0) echo '<td>Unlimited</td>';
|
else if ($offers['type'] == 3 && $offers['count'] == 0) echo '<td>Unlimited</td>';
|
||||||
@ -105,7 +105,7 @@ if ($config['shop_auction']['characterAuction']) {
|
|||||||
?>
|
?>
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
<input type="hidden" name="buy" value="<?php echo (int)$key; ?>">
|
<input type="hidden" name="buy" value="<?php echo (int)$key; ?>">
|
||||||
<input type="submit" value=" PURCHASE " class="needconfirmation" data-item-name="<?php echo $offers['describtion']; ?>" data-item-cost="<?php echo $offers['points']; ?>">
|
<input type="submit" value=" PURCHASE " class="needconfirmation" data-item-name="<?php echo $offers['description']; ?>" data-item-cost="<?php echo $offers['points']; ?>">
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user