mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
Making mounts order available only for 8.7 and above (#440)
* mounts only 8.7 and up
This commit is contained in:
parent
1ae01ee342
commit
17f1ffee95
@ -1,6 +1,11 @@
|
||||
-- <globalevent name="Znote Shop" interval="30000" script="znoteshop.lua"/>
|
||||
-- Znote Auto Shop v2.1 for Znote AAC on TFS 1.2+
|
||||
function onThink(interval, lastExecution)
|
||||
local shopTypes = {1,5,7}
|
||||
-- If game support mount orders
|
||||
if Game.getClientVersion().min >= 870 then
|
||||
table.insert(shopTypes, 6);
|
||||
end
|
||||
local orderQuery = db.storeQuery([[
|
||||
SELECT
|
||||
MIN(`po`.`player_id`) AS `player_id`,
|
||||
@ -13,7 +18,7 @@ function onThink(interval, lastExecution)
|
||||
ON `po`.`player_id` = `p`.`id`
|
||||
INNER JOIN `znote_shop_orders` AS `shop`
|
||||
ON `p`.`account_id` = `shop`.`account_id`
|
||||
WHERE `shop`.`type` IN(1,5,6,7)
|
||||
WHERE `shop`.`type` IN(]] .. table.concat(shopTypes, ",") .. [[)
|
||||
GROUP BY `shop`.`id`
|
||||
]])
|
||||
-- Detect if we got any results
|
||||
@ -100,6 +105,7 @@ function onThink(interval, lastExecution)
|
||||
end
|
||||
end
|
||||
|
||||
if Game.getClientVersion().min >= 870 then
|
||||
-- ORDER TYPE 6 (Mounts)
|
||||
if orderType == 6 then
|
||||
served = true
|
||||
@ -114,6 +120,7 @@ function onThink(interval, lastExecution)
|
||||
print("Process canceled. [".. player:getName() .."] already have mount: ["..orderItemId.."].")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ORDER TYPE 7 (Direct house purchase)
|
||||
if orderType == 7 then
|
||||
|
@ -1,6 +1,11 @@
|
||||
local globalevent = GlobalEvent("ShopSystemGlobal")
|
||||
|
||||
function globalevent.onThink(...)
|
||||
local shopTypes = {1,5,7}
|
||||
-- If game support mount orders
|
||||
if Game.getClientVersion().min >= 870 then
|
||||
table.insert(shopTypes, 6);
|
||||
end
|
||||
local orderQuery = db.storeQuery([[
|
||||
SELECT
|
||||
MIN(`po`.`player_id`) AS `player_id`,
|
||||
@ -13,7 +18,7 @@ function globalevent.onThink(...)
|
||||
ON `po`.`player_id` = `p`.`id`
|
||||
INNER JOIN `znote_shop_orders` AS `shop`
|
||||
ON `p`.`account_id` = `shop`.`account_id`
|
||||
WHERE `shop`.`type` IN(1,5,6,7)
|
||||
WHERE `shop`.`type` IN(]] .. table.concat(shopTypes, ",") .. [[)
|
||||
GROUP BY `shop`.`id`
|
||||
]])
|
||||
-- Detect if we got any results
|
||||
|
@ -76,6 +76,7 @@ function talkaction.onSay(player)
|
||||
end
|
||||
end
|
||||
|
||||
if Game.getClientVersion().min >= 870 then
|
||||
-- ORDER TYPE 6 (Mounts)
|
||||
if q_type == 6 then
|
||||
served = true
|
||||
@ -88,6 +89,7 @@ function talkaction.onSay(player)
|
||||
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You already have this mount!")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ORDER TYPE 7 (Direct house purchase)
|
||||
if orderType == 7 then
|
||||
|
@ -76,6 +76,7 @@ function onSay(player, words, param)
|
||||
end
|
||||
end
|
||||
|
||||
if Game.getClientVersion().min >= 870 then
|
||||
-- ORDER TYPE 6 (Mounts)
|
||||
if q_type == 6 then
|
||||
served = true
|
||||
@ -88,6 +89,7 @@ function onSay(player, words, param)
|
||||
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You already have this mount!")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ORDER TYPE 7 (Direct house purchase)
|
||||
if orderType == 7 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user