Zbiegniew Cebula
Active User
- Joined
- Nov 12, 2008
- Messages
- 148
- Reaction score
- 4
Odp: Summon monsters.
O a teraz takie co? :/
Mo?e u?y? jako? storage value?
Ja storage nie umiem si? niestety pos?ugiwa? ;(
@edit
A do czego to?:
@edit.2
Mam pomys?, nie wypr?buj? go lecz si? pytam czy by m?g? taki by?:
Zamiast:
To:
(Gdzie summ.numer oczywi?cie w tablice by si? wpisa?o po kolei numerki potwor?w )
No i prawdopodobnie trzeba by?oby w creaturescripts
Prosz? o informacj? dotycz?c? czy to jest dobre czy z?e
O a teraz takie co? :/
M?j skrypt jest taki:Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/summonowanie_levelowe.luanSay
data/talkactions/scripts/summonowanie_levelowe.lua:32: attempt to call global 'g
etPlayerSummons' (a nil value)
PHP:
function onSay(cid, words, param)
local count_to_lv = {5, 10, 20, 40, 80, 100}
local levels = {1, 2, 3, 4, 5, 6}
local keys = 10001
local lv_storage = 10000
local exhausted_storagevalue = 10002
local exhausted_seconds = 120
local pos = getCreaturePosition(cid)
local storages = getPlayerStorageValue(cid, keys)
if getPlayerStorageValue(cid, lv_storage) == -1 or storages == -1 then
setPlayerStorageValue(cid, lv_storage, 0)
storages = 10003
end
local summons = {
["Wilk Bojowy"] = {level = 5, skill_level = 0, name = "Wilk Bojowy", mana = 20, voc = {4,1,2,3}},
["Wilk Wojenny"] = {level = 10, skill_level = 1, name = "Wilk Wojenny", mana = 50, voc = {4,1,2,3}},
["Tresowany Minotaur"] = {level = 15, skill_level = 2, name = "Tresowany Minotaur", mana = 100, voc = {4,1,2,3}},
["Minotaur Mag"] = {level = 20, skill_level = 3, name = "Minotaur Mag", mana = 120, voc = {1}},
["Minotaur Strzelec"] = {level = 20, skill_level = 3, name = "Minotaur Strzelec", mana = 120, voc = {3}},
["Minotaur Wojownik"] = {level = 20, skill_level = 3, name = "Minotaur Wojownik", mana = 120, voc = {4}},
["Minotaur Ochroniarz"] = {level = 20, skill_level = 3, name = "Minotaur Ochroniarz", mana = 120, voc = {2}}
}
local max_summons = 1
local summ = summons[tostring(param)]
if summ then
if os.time() > getPlayerStorageValue(cid, exhausted_storagevalue) then
if not(getTilePzInfo(pos) == true or getTileHouseInfo(pos) == true) then
if getPlayerStorageValue(cid, lv_storage) >= summ.skill_level then
if isInArray(summ.voc, getPlayerVocation(cid)) then
if getPlayerLevel(cid) >= summ.level then
if getPlayerMana(cid) >= summ.mana then
local summons = getPlayerSummons(cid)
if(table.maxn(summons) <= max_summons-1) then
local mob = doSummonCreature(summ.name, pos)
doConvinceCreature(cid, mob)
doPlayerAddMana(cid, -summ.mana, false)
doPlayerAddSpentMana(cid, summ.mana)
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
doCreatureSay(cid, words.." "..param, TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
for i = 1, #count_to_lv do
if storages == count_to_lv[i] then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Twoja zdolnosc przywolywania potworow wzrosla na poziom "..i)
doSendMagicEffect(pos, CONST_ME_MORTAREA)
setPlayerStorageValue(cid, lv_storage, levels[i])
end
if storages <= count_to_lv[i] then
setPlayerStorageValue(cid, keys, storages + 1)
end
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Nie mozesz przywolac wiekszej ilosci potworow.")
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Masz za malo many.")
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Twoj poziom doswiadczenia jest za niski.")
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Nie jestes w stanie przywolac tego stworzenia.")
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Twoj poziom znajomosci przywolywania potworow jest zbyt niski.")
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Musisz opuscic strefe Ochronna.")
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Jestes zmeczony.")
end
else
doSendMagicEffect(pos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Nie jestes w stanie przywolac tego stworzenia.")
end
return true
end
Ja storage nie umiem si? niestety pos?ugiwa? ;(
@edit
A do czego to?:
PHP:
if(table.maxn(summons) <= max_summons-1) then
@edit.2
Mam pomys?, nie wypr?buj? go lecz si? pytam czy by m?g? taki by?:
Zamiast:
PHP:
local summons = getPlayerSummons(cid)
PHP:
if (getPlayerStorageValue(cid, 666) <= max_summons-1) then
setPlayerStorageValue(cid, 666, 1)
setPlayerStorageValue(cid, 667, summ.numer)
No i prawdopodobnie trzeba by?oby w creaturescripts
Je?eli umrze potw?r o nazwie np.: Wilk Bojowy i je?eli storage value 667 == 1 (albo co innego) to
ustaw storage value 666 na 0
end
return 1
end
Prosz? o informacj? dotycz?c? czy to jest dobre czy z?e
Last edited: