Ir para conteúdo

Vocação Doll


subyth

Posts Recomendados

Bem, Primeiramente boa tarde para todos.

Estou com um problema que não consigo arrumar pelo fato de não entender muito bem script...

 

Meu Script de Vocação Doll está funcionando perfeitamente, ele adiciona a nova vocação, da remove no item e adiciona o storagevalue para o player! O unico problema é que quando o player reloga a vocação adicionada some completamente e ele volta para a vocação anterior...

Quero dizer que a vocação adicionada ao player não salva mais o storagevalue sim, e o item (Doll) some normalmente. Tem como me ajudarem?

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1992) == 1 then
doCreatureSay(cid, "Você ja recebeu a nova vocaçao", TALKTYPE_ORANGE_1)
else if getPlayerLevel(cid) >= 1000 then -- a partir de que level podera usar
doCreatureSay(cid, "você recebeu uma nova vocaçao!", TALKTYPE_ORANGE_1)
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
doPlayerSetVocation(cid, 9)
end
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
doPlayerSetVocation(cid, 9)
end
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
doPlayerSetVocation(cid, 10)
end
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
doPlayerSetVocation(cid, 11)
end
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
doPlayerSetVocation(cid, 12)
end
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1992,1)
return TRUE
else
doCreatureSay(cid, "Você deve ter level 1000 ou mais para usar o Item!",TALKTYPE_ORANGE_1)
end
end
end

 

Tipo, e também tem como me ajudar com a vocação nova? tipo, ela está funcionando quase perfeitamente, o unico problema é que ela funciona mais fica sem pode usar os items das vocações e também sem pode usar as spells... E para acrescentar Id por id em cada item ou ate mesmo spells fica muito cansativo, não teria um outro geito?

logo abaixo está o Vocations.Xml e Lib/031-vocations.lua

 

Vocations.XML

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
   <vocation id="0" name="Administrador" description="administrador" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="400" 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="Master Sorcerer" description="a master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.1" attackspeed="500" 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="Elder Druid" description="a elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.1" attackspeed="500" 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="Royal Paladin" description="a  royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="50" gainmanaticks="4" gainmanaamount="50" manamultiplier="1.4" attackspeed="500" 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="Elite Knight" description="a elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="50" gainmanaticks="6" gainmanaamount="50" manamultiplier="3.0" attackspeed="500" 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="War Master Sorcerer" description="a war master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="480" 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="War elder Druid" description="an war elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="480" 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="War Royal Paladin" description="a war royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="100" manamultiplier="1.4" attackspeed="480" 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="War Elite Knight" description="an war elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="50" gainmanaticks="4" gainmanaamount="100" manamultiplier="3.0" attackspeed="480" 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="[GOD] Master Sorcerer" description="an [god] master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="470" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="50">
       <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.1" defense="1.1" magDefense="1.1" armor="1.1"/>
       <skill fist="1.4" club="1.9" sword="1.9" axe="1.9" distance="1.9" shielding="1.6" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="10" name="[GOD] Elder Druid" description="an [god] elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="470" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50">
       <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.1" defense="1.1" magDefense="1.1" armor="1.1"/>
       <skill fist="1.4" club="1.7" sword="1.7" axe="1.7" distance="1.7" shielding="1.6" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="11" name="[GOD] Royal Paladin" description="an [god] royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="100" manamultiplier="1.4" attackspeed="470" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50">
       <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.1" defense="1.1" magDefense="1.1" armor="1.1"/>
       <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.0" shielding="1.2" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="12" name="[GOD] Elite Knight" description="an [god] elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="50" gainmanaticks="4" gainmanaamount="100" manamultiplier="3.0" attackspeed="470" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50">
       <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.1" defense="1.1" magDefense="1.1" armor="1.1"/>
       <skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.3" shielding="1.2" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="13" name="[EVIL] Master Sorcerer" description="an [evil] master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="50">
       <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.1" magDamage="1.1" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
       <skill fist="1.6" club="2.1" sword="2.1" axe="2.1" distance="2.1" shielding="1.4" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="14" name="[EVIL] Elder Druid" description="an [evil] elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50">
       <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.1" magDamage="1.1" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
       <skill fist="1.6" club="2.1" sword="2.1" axe="2.1" distance="2.1" shielding="1.4" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="15" name="[EVIL] Royal Paladin" description="an [evil] royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="100" manamultiplier="1.4" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50">
       <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.1" magDamage="1.1" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
       <skill fist="1.3" club="1.3" sword="1.3" axe="1.3" distance="1.2" shielding="1.0" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="16" name="[EVIL] Elite Knight" description="an [evil] elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="50" gainmanaticks="4" gainmanaamount="100" manamultiplier="3.0" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50">
       <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.1" magDamage="1.1" 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.5" shielding="1.0" fishing="1.1" experience="1.0"/>
   </vocation>
</vocations>

 

031-vocations.lua

function isSorcerer(cid)
   return isInArray({1, 5, 9, 13}, getPlayerVocation(cid))
end

function isDruid(cid)
   return isInArray({2, 6, 10, 14}, getPlayerVocation(cid))
end

function isPaladin(cid)
   return isInArray({3, 7, 11, 15}, getPlayerVocation(cid))
end

function isKnight(cid)
   return isInArray({4, 8, 12, 16}, getPlayerVocation(cid))
end

function isRookie(cid)
   return isInArray({0}, getPlayerVocation(cid))
end

 

Agradeço, e caso consigam me ajudar REP+ para todos!

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...