Lukas |
Wysłany: Sob 21:40, 23 Gru 2006 Temat postu: NPC Policjant ^^ |
|
Na Specjalne Życzenie ** ***** NPC Policjant, ktory po przeklnieciu wali z sd ( z czaru ktory wyglada jak sd) Gdyby nie dzialal GM napisz mi to na tibii.
w data/npc/Policjant.xml
| |
<?xml version="1.0"?>
<npc name="Policjant" script="data/npc/scripts/Policjant.lua" access="3">
<look type="128" head="20" body="100" legs="50" feet="99"/>
</npc>
|
data/npc/scrips/Policjantl.lua
| |
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ) or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, 'l ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ) or msgcontains(msg, ' ... ') and focus == 0) and getDistanceToCreature(cid) < 4 then
selfSay('/kick ' .. creatureGetName(cid) .. '')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'fuck') then
selfSay('exevo mort "' .. creatureGetName(cid) .. '')
elseif msgcontains(msg, 'pies')or msgcontains(msg, 'piesek')or msgcontains(msg, 'nie')or msgcontains(msg, 'Rany boskie, jestem kioskiem') then
selfSay('Masz za swoje brudasie ' .. creatureGetName(cid) .. ' ,i nie pokazuj mi się tu wiecej.')
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('SPADAJ')
elseif focus == cid then
talk_start = os.clock()
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Moze kutas juz niewruci, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,20)
if randmove == 1 then
nx = cx + 2
end
if randmove == 2 then
nx = cx - 2
end
if randmove == 3 then
ny = cy + 2
end
if randmove == 4 then
ny = cy - 2
end
if randmove == 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
end
|
teraz tylko trzeba jeszcze czar zrobic a wiec w data/spells/instant tworzymy plik exevo mort.lua i wklejamy do niego
| | area = {
{0, 0, 0},
{0, 1, 0},
{0, 0, 0}
}
attackType = ATTACK_PHYSICAL
needDirection = false
areaEffect = NM_ME_MORT_AREA
animationEffect = NM_ANI_SUDDENDEATH
hitEffect = NM_ME_MORT_AREA
damageEffect = NM_ME_MORT_AREA
animationColor = RED
offensive = true
drawblood = true
HealFriendObject = MagicDamageObject(attackType, animationEffect, hitEffect, damageEffect, animationColor, offensive, drawblood, 0, 0)
function onCast(cid, creaturePos, level, maglv, var)
centerpos = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z} targetpos = getPosition(var)
if (level * 2 + maglv * 3) >= 100 then
HealFriendObject.minDmg = (level * 2 + maglv * 3) * 0.906
HealFriendObject.maxDmg = (level * 2 + maglv * 3) * 1.267
elseif (level * 2 + maglv * 3) < 100 then
HealFriendObject.minDmg = 100 * 0.906
HealFriendObject.maxDmg = 100 * 1.267
end
if targetpos.x ~= nil and targetpos.z ~= nil and targetpos.y ~= nil then
if math.abs(targetpos.x - centerpos.x) < 8 and math.abs(targetpos.y - centerpos.y) < 6 and targetpos.z == centerpos.z then
return doTargetMagic(cid, targetpos, HealFriendObject:ordered())
end
end
return false
end |
teraz tylko wkleic w spells.xml pod linijka
<spell name="invis" words="invis" maglv="4000" mana="800" enabled="1"></spell>
wkleic
<spell name="npc atakuje" words="exevo mort" maglv="0" mana="0" enabled="1"><vocation id="5" /></spell>
koniec to nie sd ale wyglada jak sd oczywiscie wali po srednio -/+100
mozna zmienic.
taa podziekowania na tibii :p
mam nadzieje ze bedzie dzialac. oczywiscie w miejsce ... wstawic przeklenstwa xD.
Pzdr |
|