tibiaa4e 86 Postado Outubro 8, 2008 Share Postado Outubro 8, 2008 Esse npc achei muito interressante e não é meu Peguei no otfans Ele mata pks,monstros que chegam perto dele Ele é um npc guarda Funciona apenas em TFS 0.20 + Em npcs adicione xxx.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Defender Sauron" script="data/npc/scripts/defender.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="130" head="114" body="114" legs="114" feet="114" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. I'm defender of Kni. I'm busy, don't waste my time!"/> <parameter key="message_walkaway" value="Good bye."/> <parameter key="HitInterval" value="1000" /> <parameter key="ShootEffect" value="31" /> <!-- CONST_ANI_SUDDENDEATH --> <parameter key="HitEffect" value="17" /> <!-- CONST_ME_MORTAREAR --> <parameter key="TypeDmg" value="1024" /> <!-- COMBAT_HOLYDAMAGE --> <parameter key="minDamage" value="150" /> <parameter key="maxDamage" value="700" /> <parameter key="sayText" value="Exori Vis" /> <parameter key="multiAttack" value="1" /> <parameter key="hitSkulledPlayer" value="1" /> <parameter key="minHeal" value="50" /> <parameter key="maxHeal" value="150" /> <parameter key="dmgRadiusX" value="7" /> <parameter key="dmgRadiusY" value="5" /> <parameter key="healRadiusX" value="3" /> <parameter key="healRadiusY" value="3" /> </parameters> </npc> E npcs/scripts adicione defender.lua NpcSystem.parseParameters(npcHandler) local guard = defender:new() guard:setHitInterval(getNpcParameter("HitInterval")) guard:setShootEffect(getNpcParameter("ShootEffect")) guard:setHitEffect(getNpcParameter("HitEffect")) guard:setTypeDmg(getNpcParameter("TypeDmg")) guard:setDamage(getNpcParameter("minDamage"),getNpcParameter("maxDamage")) guard:setSayText(getNpcParameter("sayText")) guard:setHeal(getNpcParameter("minHeal"),getNpcParameter("maxHeal")) guard:setHitSkulledPlayer(getNpcParameter("hitSkulledPlayer")) guard:setMultiAttack(getNpcParameter("multiAttack")) guard:setDmgRadius(getNpcParameter("dmgRadiusX"),getNpcParameter("dmgRadiusY")) guard:setHealRadius(getNpcParameter("healRadiusX"),getNpcParameter("healRadiusY")) function onThink() guard:onThink(getNpcCid()) npcHandler:onThink() end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end npcHandler:addModule(FocusModule:new()) E em /data/npc/lib/npc.lua adicione na primeira linha : dofile('data/npc/lib/creature.lua') na mesma pasta crie creature.lua e adicione ; -- @ Mehah and Gesior function OTSYS_TIME() return os.clock()*1000 end defender = { cid = 0, targetList = {}, targetTime = OTSYS_TIME(), hitInterval = 1000, shootEffect = CONST_ANI_THROWINGSTAR, hitEffect = CONST_ME_HITAREA, typeDmg = COMBAT_PHYSICALDAMAGE, minDmg = 300, maxDmg = 1200, sayText = "", minHeal = 1, maxHeal = 10, hitSkulledPlayer = 1, multiAttack = 1, dmgRadiusX = 7, dmgRadiusY = 5, healRadiusX = 3, healRadiusY = 3, } function defender:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end function defender:onThink(_cid) if self.cid == 0 then self.cid = _cid return end local _time = OTSYS_TIME() if (_time - self.targetTime) > self.hitInterval then self.targetTime = _time local position = getCreaturePosition(self.cid) local creature = {} local pos = {x = 0, y = 0, z = 0, stackpos = 0} if self.minDmg > 0 and self.maxDmg > 0 then self:clearTargetList() for x = -self.dmgRadiusX, self.dmgRadiusX do for y = -self.dmgRadiusY, self.dmgRadiusY do if not (x == 0 and y == 0) then pos = {x = position.x+x, y = position.y+y, z = position.z, stackpos = STACKPOS_TOP_CREATURE} creature = getTopCreature(pos) if (creature.type == 2) or (creature.type == 1 and self.hitSkulledPlayer == 1 and getPlayerSkullType(creature.uid) > 0) then if self.multiAttack ~= 1 and #self.targetList > 0 then break end self:addTarget(creature.uid) self:doSendDamage(creature.uid) end end end end if #self.targetList > 0 then if self.sayText ~= "" then doCreatureSay(self.cid, self.sayText, TALKTYPE_ORANGE_1) end end end if self.minHeal > 0 and self.maxHeal > 0 then self:clearTargetList() for x = -self.healRadiusX, self.healRadiusX do for y = -self.healRadiusY, self.healRadiusY do if not (x == 0 and y == 0) then pos = {x = position.x+x, y = position.y+y, z = position.z, stackpos = STACKPOS_TOP_CREATURE} creature = getTopCreature(pos) if (creature.type == 1) then self:doHeal(creature.uid) end end end end end end end function defender:doSendDamage(target) if isCreature(target) == TRUE then local hitDmg = math.random(self.minDmg, self.maxDmg) if getCreatureHealth(target) <= hitDmg then doSetCreatureDropLoot(target, 0) end doSendDistanceShoot(getCreaturePosition(self.cid), getCreaturePosition(target), self.shootEffect) doTargetCombatHealth(self.cid, target, self.typeDmg, -hitDmg, -hitDmg, self.hitEffect) end end function defender:doHeal(target) doTargetCombatHealth(self.cid, target, COMBAT_HEALING, self.maxHeal, self.minHeal, CONST_ME_MAGIC_BLUE) end function defender:addTarget(_target) table.insert(self.targetList,_target) end function defender:clearTargetList() self.targetList = {} end function defender:setHitInterval(hitInterval) self.hitInterval = tonumber(hitInterval) end function defender:setShootEffect(shootEffect) self.shootEffect = shootEffect end function defender:setHitEffect(hitEffect) self.hitEffect = hitEffect end function defender:setTypeDmg(typeDmg) self.typeDmg = typeDmg end function defender:setSayText(sayText) self.sayText = tostring(sayText) end function defender:setDamage(minDmg,maxDmg) self.minDmg = tonumber(minDmg) self.maxDmg = tonumber(maxDmg) end function defender:setHeal(minHeal,maxHeal) self.minHeal = tonumber(minHeal) self.maxHeal = tonumber(maxHeal) end function defender:setHitSkulledPlayer(hitSkulledPlayer) self.hitSkulledPlayer = tonumber(hitSkulledPlayer) end function defender:setMultiAttack(multiAttack) self.multiAttack = tonumber(multiAttack) end function defender:setDmgRadius(dmgRadiusX,dmgRadiusY) self.dmgRadiusX = tonumber(dmgRadiusX) self.dmgRadiusY = tonumber(dmgRadiusY) end function defender:setHealRadius(healRadiusX,healRadiusY) self.healRadiusX = tonumber(healRadiusX) self.healRadiusY = tonumber(healRadiusY) end Depois coloque-o no mapa Quando ele mata um monstro O monstro não dá loot creditos : Gesior e Mehah Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/ Compartilhar em outros sites More sharing options...
Gofaia 1 Postado Outubro 8, 2008 Share Postado Outubro 8, 2008 Mwa ha ah ha... QUe massa, vou usar no meu ot... BLoody kisses Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-624442 Compartilhar em outros sites More sharing options...
Malzbier 0 Postado Outubro 9, 2008 Share Postado Outubro 9, 2008 o cara q fez isso eh um genil parabens adorei esse npc testei aki no meu ot e funcionou Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-624892 Compartilhar em outros sites More sharing options...
Gofaia 1 Postado Outubro 10, 2008 Share Postado Outubro 10, 2008 ='( Nao da pra usar no meu ot... Agora que eu vi que é pra 8.22... Bloody kisses Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-625039 Compartilhar em outros sites More sharing options...
DaNDaNrOxX 15 Postado Outubro 10, 2008 Share Postado Outubro 10, 2008 Puts, um npc muito complexo, muito bom também Bom de se usar em um lugar estratégico, tipo, fazer uma quest, com dois caminhos... se for pelo errado, da de cara com o npc, e o npc mata o cara... se for pelo caminho certo, continua normal Se bem que só mata pk Mas mesmo assim, da para fazer coisas daora com ele Abraço Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-625100 Compartilhar em outros sites More sharing options...
Gofaia 1 Postado Outubro 10, 2008 Share Postado Outubro 10, 2008 Alguem consegue ele para 8.1??? Se nao conseguirem tudo bem, ai eu faço =D Bloody kisses Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-625123 Compartilhar em outros sites More sharing options...
gon007 0 Postado Novembro 2, 2008 Share Postado Novembro 2, 2008 gostei brastante do npc mas Cara e o seguinte eu nao sei como coloko os npc/monstros no mapa ensina aew blz cra :smile_positivo: :smile_positivo: Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-634077 Compartilhar em outros sites More sharing options...
guilhermes26 26 Postado Novembro 2, 2008 Share Postado Novembro 2, 2008 surprised.gif gostei brastante do npc masCara e o seguinte eu nao sei como coloko os npc/monstros no mapa ensina aew blz cra smile_positivo.gif smile_positivo.gif Você olhou de quando é o tópico? tnte não postar em tópicos um pouco mais velhos. Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-634079 Compartilhar em outros sites More sharing options...
xXxhalloweenxXx 0 Postado Novembro 21, 2008 Share Postado Novembro 21, 2008 (editado) que rox muito maneiro.. funfo namoral.muito bom ;D metas.. [x]1post [x]5 posts (SERVO) [x]10 posts (CAMPONÊS) [x]25 posts (CAÇADOR) [x]50 posts (CAVALEIRO) [ ]100 posts (BARONETE) [ ]200 posts (BARÃO) [ ]300 posts (VISCONDE) [ ]400 posts (DUQUE) [ ]600 posts (ARQUEDUQUE) [ ]800 posts (ARISTOCRATA) [ ]1000 posts (REGENTE) [ ]1400 posts (SÁBIO) [ ]1800 posts (SACERDOTE) [ ]2500 posts (PRÍNCIPE) Editado Novembro 21, 2008 por xXhalloweenXx Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-642286 Compartilhar em outros sites More sharing options...
Brasildani 0 Postado Dezembro 20, 2008 Share Postado Dezembro 20, 2008 bagualado mermao ja to usando no meu ot Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-660549 Compartilhar em outros sites More sharing options...
_ferrari_ 1 Postado Dezembro 21, 2008 Share Postado Dezembro 21, 2008 No 8.4 nao pegou. Erro: [21/12/2008 11:50:31] data/npc/lib/npcsystem/npcsystem.lua:68: attempt to index local 'npcHandler' (a nil value) [21/12/2008 11:50:31] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/defender.lua Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-661039 Compartilhar em outros sites More sharing options...
IcarooxDloll 1 Postado Janeiro 12, 2009 Share Postado Janeiro 12, 2009 8.1 pego =x Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-674203 Compartilhar em outros sites More sharing options...
fireflames 0 Postado Fevereiro 2, 2009 Share Postado Fevereiro 2, 2009 Parece legal cara mais axo q nao vou usar,porque quando fazer invasão ele provavelmente irá matar, mais axei mto massa Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-689123 Compartilhar em outros sites More sharing options...
satan666 12 Postado Março 11, 2009 Share Postado Março 11, 2009 vo verifica pra ve se funciona em outras versoes.. flw pela ajuda e por ter postado esse npc.... Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-709046 Compartilhar em outros sites More sharing options...
amauri32ibate 0 Postado Julho 11, 2010 Share Postado Julho 11, 2010 (editado) Eu dei uma adaptada pra ele rodar em 8.54, não verdade foi mais uma cortada XD Lembrando que não testei ele em PK ainda, se alguem testar me responda. <?xml version="1.0" encoding="UTF-8"?> <npc name="Defender Sauron" script="data/npc/scripts/defender.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="130" head="114" body="114" legs="114" feet="114" addons="3"/> <parameters> <parameter key="HitInterval" value="3000" /> <parameter key="ShootEffect" value="37" /> <parameter key="HitEffect" value="39" /> <parameter key="TypeDmg" value="1024" /> <parameter key="minDamage" value="150" /> <parameter key="maxDamage" value="700" /> <parameter key="sayText" value="Exori San" /> <parameter key="multiAttack" value="1" /> <parameter key="hitSkulledPlayer" value="1" /> <parameter key="minHeal" value="50" /> <parameter key="maxHeal" value="150" /> <parameter key="dmgRadiusX" value="7" /> <parameter key="dmgRadiusY" value="5" /> <parameter key="healRadiusX" value="3" /> <parameter key="healRadiusY" value="3" /> </parameters> </npc> e no lua ficou sendo assim NpcSystem.parseParameters(npcHandler) local guard = defender:new() guard:setHitInterval(getNpcParameter("HitInterval")) guard:setShootEffect(getNpcParameter("ShootEffect")) guard:setHitEffect(getNpcParameter("HitEffect")) guard:setTypeDmg(getNpcParameter("TypeDmg")) guard:setDamage(getNpcParameter("minDamage"),getNpcParameter("maxDamage")) guard:setSayText(getNpcParameter("sayText")) guard:setHeal(getNpcParameter("minHeal"),getNpcParameter("maxHeal")) guard:setHitSkulledPlayer(getNpcParameter("hitSkulledPlayer")) guard:setMultiAttack(getNpcParameter("multiAttack")) guard:setDmgRadius(getNpcParameter("dmgRadiusX"),getNpcParameter("dmgRadiusY")) guard:setHealRadius(getNpcParameter("healRadiusX"),getNpcParameter("healRadiusY")) function onThink() guard:onThink(getNpcCid()) end Infelismente ele não fala mais, porém é melhor que nada, pelo menos pra min esta sendo... ESTE É MEU SEGUNDO POST. FAÇO SPELLS E OUTROS SCRIPT EM .LUA, VOU VER SE POST UMAS E PERDOE MEU PORTUGUÊS Editado Julho 12, 2010 por amauribate Link para o comentário https://xtibia.com/forum/topic/98006-822-guarda-de-cidade/#findComment-904785 Compartilhar em outros sites More sharing options...
Posts Recomendados