SK

Spells Requerindo Skill

Por SkyDangerous, 19 de set. de 2011 em Tutoriais de Scripting

script
6
2.1k
SkyDangerousS
19 de setembro de 2011 às 18:34

Tutorial: Soltando magia se tiver tanto de skill.

Nivél: Expert Avançado.

 

Esse sistema é perfeito para quem gosta de  Dragon Ball, Naruto, Bleach e etc.

 

Aplicação após a implementação do sistema na spells.xml:

instant name="XXX" words="xxxx" clubpoints="XX" lvl="XX" mana="XX" aggressive=XX" selftarget="XX" exhaustion="XXX" event="script" value="XXX.lua"/>

 

 

1) Procure por player.cpp

case RET_TILEISFULL:
sendCancel("You cannot add more items on this tile.");
break;

 

e cola em cima do código

 

case RET_NOTENOUGHSKILL:
           sendCancel("You do not have enough club fighting.");
break; 

 

2) Declare na linha (o qual será vericado) no spells.xml

Procure por spells.cpp

if(readXMLInteger(p, "maglv", intValue) || readXMLInteger(p, "magiclevel", intValue))
magLevel = intValue;

 

e cola em cima do código

 

 if(readXMLInteger(p, "club", intValue) || readXMLInteger(p, "clubpoints", intValue))
        clubpoints = intValue;  

 

 

 

3) Adiciona na função principal

Procure novamente spells.cpp

if((int32_t)player->getMagicLevel() < magLevel)
{
player->sendCancelMessage(RET_NOTENOUGHMAGICLEVEL);
g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
return false;
}

 

e cola em cima

 

  if((int32_t)player->getSkill(SKILL_CLUB, SKILL_LEVEL) <  clubpoints)
   {
       player->sendCancelMessage(RET_NOTENOUGHSKILL);
       g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
       return false;
   }  

 

4) Procure spells.h

Procure essa linha

int32_t getMagicLevel() const {return magLevel;}

 

cola em cima

 

uint32_t getSkill() const {return clubpoints;}  

 

Procure novamente essa linha

int32_t magLevel;

 

cola em cima

 

  int32_t clubpoints; 

 

5) Procure things.h

E procure essa linha

RET_TILEISFULL = 64,

 

e cola em cima

 

RET_NOTENOUGHTRAINPOINTS = 65  

 

Para Configurar:

Formula do spells:

(ex. level*2 + clubpoints*2)

 

Créditos

SkyDangerous
Fresh

Editado Setembro 19 por SkyDangerous

BeekiB
19 de setembro de 2011 às 18:47

Nossa beautiful muito massa vou usar isso ai no meu Bleach vlw aiii :D

 

REP + pra vc :p

SkyDangerousS
19 de setembro de 2011 às 19:03

:)

 

Façam um bom aproveito.

Para quem sabe compilar as paradas.

 

Abraços , em breve mais códigos para vocês.

19 de setembro de 2011 às 19:33

o fresh é bom no assunto mas faz algumas coisas sem testar

 

ja que vc trouxe deve funcionar :thumbsupsmiley:

 

é uma bom feature para ats

 

rep+

SkyDangerousS
19 de setembro de 2011 às 19:47

:p

 

Saca só

 

semttuloug.jpg

 

kkkk'

 

-=-=

 

Vlw pelos elogios :p

147963lol1
21 de setembro de 2011 às 15:26

Cara, parabéns, totalmente útil. Com isso podemos até criar magias secundárias para o Tibia, ficaria bem divertido em um lowrate.

 

Att. vou fazer testes em meu servidor...