Ir para conteúdo
  • Cadastre-se

NPC com um pequeno defeito.


Posts Recomendados

 

-- configs

pricetobuff = 2000
invisibleseconds = 600
magicshieldseconds = 600
skillsseconds = 600
skillsupgrade = {}
skillsupgrade['fist'] = 10
skillsupgrade['club'] = 10
skillsupgrade['sword'] = 10
skillsupgrade['axe'] = 10
skillsupgrade['distance'] = 10
skillsupgrade['shield'] = 10
skillsupgrade['ml'] = 7
-- end configs
 
 
-- invisible combat
local combatInvisible = createCombatObject()
setCombatParam(combatInvisible, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combatInvisible, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_INVISIBLE)
setConditionParam(condition, CONDITION_PARAM_TICKS, invisibleseconds*1000)
setCombatCondition(combatInvisible, condition)
 
-- utamo combat
local combatUtamo = createCombatObject()
setCombatParam(combatUtamo, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combatUtamo, COMBAT_PARAM_AGGRESSIVE, 0)
 
local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, magicshieldseconds*1000)
setCombatCondition(combatUtamo, condition)
 
-- melee condition
local conditionMelee = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMelee, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_FIST, skillsupgrade['fist'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_CLUB, skillsupgrade['club'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_SWORD, skillsupgrade['sword'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_AXE, skillsupgrade['axe'])
 
-- distance condition
local conditionDistance = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDistance, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionDistance, CONDITION_PARAM_SKILL_DISTANCE, skillsupgrade['distance'])
 
-- shield condition
local conditionShield = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionShield, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionShield, CONDITION_PARAM_SKILL_SHIELD, skillsupgrade['shield'])
 
-- ml condition
local conditionMagic = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMagic, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionMagic, CONDITION_PARAM_STAT_MAGICPOINTS, skillsupgrade['ml'])
 
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
 
function buff(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if doPlayerRemoveMoney(cid, pricetobuff) == TRUE then
buff = parameters.buff
message = parameters.message
 
doCombat(cid, buff, numberToVariant(cid))
npcHandler:say(message, cid)
keywordHandler:moveUp(1)
return true
else
npcHandler:say("You need ".. pricetobuff .." gold coins to buff yourself.", cid)
end
end
 
function buffMelee(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if doPlayerRemoveMoney(cid, pricetobuff) == TRUE then
buff = parameters.buff
errors = 0
message = parameters.message
voc = getPlayerVocation(cid)
 
if buff == conditionMagic and (isKnight(cid) or isPaladin(cid)) then
npcHandler:say("Only master sorcerers and elder druids can upgrade their magic skills.", cid)
errors = 1
end
 
 
if errors == 0 then
doTargetCombatCondition(0, cid, buff, CONST_ME_MAGIC_RED)
npcHandler:say(message, cid)
keywordHandler:moveUp(1)
return true
end
else
npcHandler:say("You need ".. pricetobuff .." gold coins to buff yourself.", cid)
end
end
 
 
 
 
local node1 = keywordHandler:addKeyword({'invisible'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be invisible?'})
node1:addChildKeyword({'yes'}, buff, {buff = combatInvisible, message = 'Now you are invisible!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'magic shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to get magic shield effect?'})
node1:addChildKeyword({'yes'}, buff, {buff = combatUtamo, message = 'Your magic shield is on!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'melee'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your melee skills for some time?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionMelee, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your shield skills for some time?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionShield, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'distance'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your distance skills for some time?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionDistance, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'magic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your magic skills for some time?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionMagic, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Uhm?"})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ya?"})
 
npcHandler:addModule(FocusModule:new())

 

 

então galera esse npc esta funcionando quase perfeitamente, para vocações normal ele funciona sem problemas, porem se eu colocar uma segunda vocação o npc não reconhece as vocações e add os buffer pra Epic Knight e Epic Paladin.

 

 

 

if buff == conditionMagic and (isKnight(cid) or isPaladin(cid)) then

npcHandler:say("Only master sorcerers and elder druids can upgrade their magic skills.", cid)
errors = 1
end

 

se for knight e paladin não add o buffer de magic level, agora se for epic knight (voc 12) e epic paladin (voc 11), ele ja da magic.

 

se alguém souber como corrigir ficarei grata.

 Whatsapp: +55 (48) 98815-0709 Discord: Qwizer#5713

 

Global 100% 7.40 com Website

TFS 1.2 10.97-11.00 + GlobalFull OtherWorld ...

 

Link para o post
Compartilhar em outros sites

me manda seu vocation.xml, talvez lá nao esteja agrupado as vocations e ai ele nao entende que EPIC KNIGHT É = ELITE KNIGHT = KNIGHT e paladin tbm

Link para o post
Compartilhar em outros sites

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
<vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="2">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="4">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="9" name="Epic Master Sorcerer" description="an epic master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="50">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="10" name="Epic Elder Druid" description="an epic elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="11" name="Epic Royal Paladin" description="an epic royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="12" name="Epic Elite Knight" description="an epic elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
</vocations>
 
 
ai esta.
Editado por AnaPaula (veja o histórico de edições)

 Whatsapp: +55 (48) 98815-0709 Discord: Qwizer#5713

 

Global 100% 7.40 com Website

TFS 1.2 10.97-11.00 + GlobalFull OtherWorld ...

 

Link para o post
Compartilhar em outros sites

ninguem pode ajudar eu nunca consigo nada do que preciso aqui nesse fórum e sacanagem só pode.

 Whatsapp: +55 (48) 98815-0709 Discord: Qwizer#5713

 

Global 100% 7.40 com Website

TFS 1.2 10.97-11.00 + GlobalFull OtherWorld ...

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo