- Mesaj
- 354
- Çözümler
- 3
- Beğeni
- 250
- Puan
- 764
- Ticaret Puanı
- 0
lua tarafını pek beceremedim ama sistem fonksiyonel olarak çalışıyor tamamen çalıştığında paylaşıcam
shop_guardian
şu an tek eksik pk mode serbeste alınca pazarların kesilmesini sağlamak ve kesilen pazardaki itemler hopp yere düşer
şu kod sorunlu biri yardım etsin la azcık
şu bitsinde paylaşayım istiyorum seri yardım edin çabukkkkkkkkkkk
shop_guardian
shop_guardian.quest:
quest shop_guardian begin
state start begin
when 50037.use begin
say_title("Shop Guardian Services")
say("Our organization offers premium protection for your shop.")
say("We summon legendary beasts to guard your wares against")
say("thieves and attackers.")
say("")
say_reward("Who do you wish to hire?")
local mob_list = {
{ "Orc Chief (Cheap)", 691, 2000000 },
{ "Flame King (Hot)", 2206, 100000000 },
{ "Grim Reaper (Deadly)", 1093, 500000000 },
{ "Blue Dragon (Legengary)", 2493, 1000000000 }
}
local choices = {}
for i, mob in ipairs(mob_list) do
table.insert(choices, string.format("%s - %s Yang", mob[1], number_format(mob[3])))
end
table.insert(choices, "Nevermind")
local s = select_table(choices)
if s == table.getn(choices) then return end
local selected_mob = mob_list[s]
local vnum = selected_mob[2]
local price = selected_mob[3]
say_title("Confirm Contract")
say("You are about to hire: " .. selected_mob[1])
say("Price: " .. number_format(price) .. " Yang")
say("Warning: The Guardian lasts until your shop closes.")
local confirm = select("Sign Contract", "Cancel")
if confirm == 2 then return end
if pc.get_gold() < price then
say("You do not have enough Yang.")
return
end
local ret = pc.summon_shop_guardian(vnum)
if ret == 1 then
pc.change_gold(-price)
syschat("Contract signed! The Guardian has arrived.")
item.remove()
else
syschat("Cannot summon guardian. Is your shop open?")
end
end
end
end
şu an tek eksik pk mode serbeste alınca pazarların kesilmesini sağlamak ve kesilen pazardaki itemler hopp yere düşer
C++:
// [MARKET_DEATH_DROP] Normal/Serbest PK'da pazar acikken kesilince itemler duser
if (pkKiller && pkKiller->IsPC() && IsPC() && GetMyShop() && !IsGM())
{
int iPKMode = GetPKMode();
// PK_MODE_PEACE (0) haricindeki tum PK modlari aktif
if (iPKMode != PK_MODE_PEACE)
{
CShop* pMyShop = GetMyShop();
const std::vector<CShop::SHOP_ITEM>& vecItems = pMyShop->GetItemVector();
int iDropCount = 0;
PIXEL_POSITION dropPos;
dropPos.x = GetX();
dropPos.y = GetY();
for (size_t iSlot = 0; iSlot < vecItems.size(); ++iSlot)
{
LPITEM pkShopItem = vecItems[iSlot].pkItem;
if (!pkShopItem)
continue;
dropPos.x = GetX() + number(-7, 7) * 20;
dropPos.y = GetY() + number(-7, 7) * 20;
LPITEM pkDropped = pkShopItem->RemoveFromCharacter();
if (pkDropped && pkDropped->AddToGround(GetMapIndex(), dropPos))
{
pkDropped->StartDestroyEvent();
sys_log(0, "[MARKET_DEATH_DROP] %s dustu (sahip: %s, killer: %s)",
pkDropped->GetName(), GetName(), pkKiller->GetName());
LogManager::instance().ItemLog(this, pkDropped, "MARKET_DEATH_DROP", pkKiller->GetName());
++iDropCount;
}
}
// Shop'u kapat
CloseMyShop();
if (iDropCount > 0)
{
sys_log(0, "[MARKET_DEATH_DROP] %s kesildi, %d item yere dustu. Killer: %s",
GetName(), iDropCount, pkKiller->GetName());
char szNotice[256];
snprintf(szNotice, sizeof(szNotice),
"[PAZAR] %s pazar acikken kesildi! %d item yere dustu!",
GetName(), iDropCount);
pkKiller->ChatPacket(CHAT_TYPE_INFO, szNotice);
}
}
}
// END_MARKET_DEATH_DROP
şu kod sorunlu biri yardım etsin la azcık
şu bitsinde paylaşayım istiyorum seri yardım edin çabukkkkkkkkkkk