Talkactions.xml:Typ: Talkactions
Opis: Prosty dla was skrypcik chodzi mi troszeczke o tego npc co da? mi Oskar, chce tak? komend? !misje kt?ra pokazuje nam jak? mamy misje
Dodatkowe: poprzedni skrypt ju? ?wietnie dzia?a dzi?ki.
talkaction words="!misja" hide="yes" event="script" value="misje.lua"/>
function onSay(cid, words, param)
local cfg = {
name_npc = "NAZWA_NPC",
storage = 5321
}
if getPlayerStorageValue(cid, cfg.storage) == -1 then
doShowTextDialog(cid, 2050, "Nie otrzymales jeszcze misji")
elseif getPlayerStorageValue(cid, cfg.storage) == 0 then
doShowTextDialog(cid, 2667, "Musisz przyniesc 10 ryb dla "..cfg.name_npc.."")
elseif getPlayerStorageValue(cid, cfg.storage) == 2 then
doShowTextDialog(cid, 6435, "Musisz zabic 10 demonow dla "..cfg.name_npc..".")
else
doShowTextDialog(cid, 6435, "Wykonales poprzednia misje. Sprawdz czy "..cfg.name_npc.." niema dla Ciebie kolejnego zadania.")
end
return true
end
local skill = {
['fist'] = SKILL_FIST,
['club'] = SKILL_CLUB,
['sword'] = SKILL_SWORD,
['axe'] = SKILL_AXE,
['distance'] = SKILL_DISTANCE,
['shield'] = SKILL_SHIELD,
['fishing'] = SKILL_FISHING,
}
function onSay(cid, words, param)
x = ""
x = 'Level - '..getPlayerLevel(cid)..'\n'
x = x .. 'Magic Level - '..getPlayerMagLevel(cid)..'\n'
if param == "" then
for k, v in pairs(skill) do
x = x .. 'Skill '..k..' - '..getPlayerSkillLevel(cid, v)..'\n'
end
end
x = x .. 'HP - '..getCreatureMaxHealth(cid)..'\n'
x = x .. 'MP - '..getCreatureMaxMana(cid)
doShowTextDialog(cid, 5785, x)
return true
end
Szukam skrypt?w na Firewalker boots QUEST, jeste? w stanie mi je poda??;x
local storage_obrazen = 4135
function onStatsChange(cid, attacker, type, combat, value)
if isCreature(cid) and isPlayer(attacker) and getPlayerStorageValue(attacker, storage_obrazen) > 0 then
if combat == COMBAT_HEALING then
return true
end
local value = value * (getPlayerStorageValue(attacker, storage_obrazen)/100)
doTargetCombatHealth(attacker, cid, combat, -value, -value, INVISIBLE_EFFECT)
return false
end
return true
end
<event type="statsChange" name="More_Dmg" event="script" value="more_dmg.lua"/>
registerCreatureEvent(cid, "More_Dmg")
local config = {
ile_dodaje_hp = 500,
o_ile_procent_zwieksza_obrazenia = 110,
ile_bierze_many = 10,
co_ile_sec = 1,
efekt_podczas_zmiany = CONST_ME_HOLYAREA
}
local storage_obrazen = 4135
function onSay(cid, words, param)
if param == "" then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + config.ile_dodaje_hp)
doPlayerSetStorageValue(cid, storage_obrazen, config.o_ile_procent_zwieksza_obrazenia)
doSendMagicEffect(getCreaturePosition(cid), config.efekt_podczas_zmiany)
doCreatureAddMana(cid, -config.ile_bierze_many, false)
addEvent(mana_gain, config.co_ile_sec * 1000, {cid = cid})
end
return true
end
function mana_gain(p)
if isPlayer(p.cid) then
if getCreatureMana(p.cid) >= config.ile_bierze_many then
doCreatureAddMana(p.cid, -config.ile_bierze_many, false)
addEvent(mana_gain, config.co_ile_sec * 1000, p)
else
doPlayerSetStorageValue(p.cid, storage_obrazen, 0)
setCreatureMaxHealth(p.cid, getCreatureMaxHealth(p.cid) - config.ile_dodaje_hp)
doCreatureAddHealth(p.cid, 1)
end
end
return true
end
local config = {
--[monster] = level,
['bog raider'] = {50}
}
function onCombat(cid, target)
local s = config[getCreatureName(target)]
if isPlayer(cid) and isMonster(target) and s then
if getPlayerLevel(cid) < s[1] then
return false
end
end
return true
end
<event type="combat" name="Bog" event="script" value="Bog.lua"/>
registerCreatureEvent(cid, "Bog")