Naprawdę nie mam już co robić czasem w nocy, to pomyślałem, że napiszę kolejny z serii bezsensownych systemów!
(piszę z serii, bo już sobie zrobiłem takie jak:
to teraz robię kolejny, mianowicie: wszystkie addony jako jeden skrypt xD zamieszczę go po skończeniu w dziale resources
Jak ma finalnie wyglądać:
Pomyślałem tak sobie, żeby go pisać "w czasie rzeczywistym na polish boardzie" xD Nie mam teraz sposobności testować pisanego skryptu, tak więc to też jest trochę powodem pisania tu. Ale też mam wiele niewiadomych jak np. czy mogę zrobić:
x = {a = "bumbik", b = {c = "dekiel", d="embrus", e = "limbus", n = {k = "trolejbus"}}}
i potem czy mogę wyciągnąć potem tak 'k':
x.b.n.k
??
chagelog:
tutaj, ZARYS skrypciku xD (w lib)
(piszę z serii, bo już sobie zrobiłem takie jak:
- wszystkie questy skrzynkowe w jednym skrypcie (jest na otlandzie: http://otland.net/f81/seminaris-que...-all-quests-one-script-sepira-project-165319/)
- wszystkie podróże - statkami, dywanami, parowcami (jeden skrypt) na all npc (narazie nie chcę udostępniać ;s)
- jestem w trakcie, wszyscy sprzedawcy akcesoriów (mana potiony, łopaty, runy, itd.) selerzy jak na rl (mało jest zrobione)
to teraz robię kolejny, mianowicie: wszystkie addony jako jeden skrypt xD zamieszczę go po skończeniu w dziale resources
Jak ma finalnie wyglądać:
- Za pomocą jedną lub paru linijek będziemy mogli go dodać do dowolnego npc'a
- System bazowo jest robiony zgodnie z global tibią, ale myślę, że osoby z evo/custom łatwo będą mogli sobie to dostosować
- Tablice finalnie będą tak przygotowane, że skrypt ukaże się w osłonach:
- NPC'ów
- talkactiona
- addon dolla
- action leversów
- ewentualnie ciekawego systemu w creaturescripts
Pomyślałem tak sobie, żeby go pisać "w czasie rzeczywistym na polish boardzie" xD Nie mam teraz sposobności testować pisanego skryptu, tak więc to też jest trochę powodem pisania tu. Ale też mam wiele niewiadomych jak np. czy mogę zrobić:
x = {a = "bumbik", b = {c = "dekiel", d="embrus", e = "limbus", n = {k = "trolejbus"}}}
i potem czy mogę wyciągnąć potem tak 'k':
x.b.n.k
??
chagelog:
Code:
18.08.2012 00:18
zmiana w sprawdzaniu required items
tutaj, ZARYS skrypciku xD (w lib)
LUA:
-- New ADDON SYSTEM --
-- ~~~~~~~~ By Seminari ~~~~~~ --
-- //// | \\\\ --
-- / __ __ \ --
-- |[*] | [*]| --
-- | ^ | --
-- \ \_____/ / --
-- --\___/-- --
-- \______/ --
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
-- v: 1.0.0
--[[
Start: 18.08.2012
Koniec: ?
]]--
-- id itemow xD
ITEMS_LEGION_HELMET =
ITEMS_CHIKCEN_FEATHER =
ITEMS_HONEYCOMB =
ADDONECZKI_STG = {
citizen_first = 2222,
}
STANDART_MSG_ADDON_COMPLETED_ALLREADY = "You allready have this addon"
STANDART_MSG_ADDON_PLAYER_DONT_HAVE_REQUIRED_ITEMS = "You don't have required items"
-- msgs, ["msg"] = {addon = "name of outfit", addon_id = "outfit/first/second"}
seminari_addons_msgs = {
["hat"] = {npc = "norma", addon = "citizen", addon_id = "first", current_storage_key = ADDONECZKI_STG.citizen_first,
missions = {
[0] = {talker = 3001, msg = "Pretty, isn't it? I made it myself, but I could teach you how to do that if you like. What do you say?"},
[1] = {talker = 3002, msg = "Oh, you're back already? Did you bring a legion helmet, 100 chicken feathers and 50 honeycombs?"},
[2] = {msg = STANDART_MSG_ADDON_COMPLETED_ALLREADY},
},
},
}
for k, v in pairs(seminari_addons_msgs) do
if msgcontains(msg, k) then
local n = getCreatureName(getNpcCid()):lower()
if v.npc == n then
local storagek = getPlayerStorageValue(cid, v.current_storage_key)
if storagek < 0 then storyg = 0 else storyg = storagek end
for p, r in pairs(v.missions) do
if storyg == p then
if r.msg ~= nil then npcHandler:say(r.msg, cid) end
if r.talker ~= nil then talkState[talkUser] = r.talker end
end
end
end
end
end
-- yes. [nr talker] =
seminari_addons_yes = {
[3001] = {npc = "norma", talker = 0, new_storage_key = ,new_storage_value = 1,
msg = "Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue.That's it, come back to me once you gathered it!!"},
[3002] = {npc = "norma", talker = 0, required_items = {ITEMS_LEGION_HELMET, 1, ITEMS_CHIKCEN_FEATHER, 100, ITEMS_HONEYCOMB, 50}, remove_items = "true",
good = {
new_storage_key = ,
new_storage_value = 2,
msg = "",
outfit_male = ,
outfit_female = ,
addon_id = 1,
},
bad = {
msg = STANDART_MSG_ADDON_PLAYER_DONT_HAVE_REQUIRED_ITEMS,
},
}
}
if msgcontains(msg, "yes") then
for f, g in pairs(seminari_addons_yes) do
if talkState[talkUser] == f then
local n = getCreatureName(getNpcCid()):lower()
if g.npc == n then
local itemySPIS = {}
if g.required_items ~= nil then
for i = 1, #g.required_items/2 do
if getPlayerItemCount(cid, g.required_items[i*2-1]) < g.required_items[i*2] then
table.insert(itemySPIS, g.required_items[i*2-1])
end
end
end
if itemySPIS ~= nil then
return npcHandler:say(g.bad.msg, cid)
else
if g.remove_items == "true" then
for i = 1, #g.required_items/2 do
doPlayerRemoveItem(cid, g.required_items[i*2-1], g.required_items[i*2])
end
end
npcHandler:say(g.good.msg, cid)
if g.good.new_storage_key ~= nil then setPlayerStorageValue(cid, g.good.new_storage_key, g.good.new_storage_value) end
if g.good.addon_id ~= nil then
if getPlayerSex(cid) == 0 then stroj = g.good.outfit_female else stroj = g.good.outfit_male end
doPlayerAddOutfit(cid, stroj, g.good.addon_id)
end
if g.good.effect ~= nil then doSendMagicEffect(getCreaturePosition(cid),g.good.effect) end
end
end
end
end
end
--[[
if canPlayerWearOutfitId(cid, outfitId, 1) == TRUE and canPlayerWearOutfitId(cid, outfitId, 2) == TRUE then
player_ma_oba <-- i tutaj np. mozemy dac, zeby mu info wyswietlalo, ze ma wszystkie addony do tego outfa i np. ze dostaje achievement :D
end
]]--
Last edited: