Ir para conteúdo

Transformando Fishing Para Fishing Fighting


yoh

Posts Recomendados

Bom dia Galera do Xtibia, hoje brincando de Scripter C++ resolvi modificar o Fishing para Fishing Fighting que no caso seria uma arma com attack que upa fishing em vez das padrões ( Axe , Sword , Club, Distance ).

Não sei se vai ser util para alguma coisa, para mim vai me ajuda em 1 sistema que verifica esse skill, a versão é 0.4... não sei fazer em outra e acredito que é bem simples porem para mim foi emocionante conseguir !

 

Vamos la !

 

em Combat.cpp :

Procure :

switch(caster->getWeaponType())

Abaixo de :

case WEAPON_FIST:
				effect = SHOOT_EFFECT_LARGEROCK;
				break;

Adicione :

case WEAPON_FISH:
				effect = SHOOT_EFFECT_WHIRLWINDCLUB;
				break;

Salve e Feche

 

em Const.h :

Procure

enum WeaponType_t

Abaixo de:

WEAPON_WAND,

Adicione :

WEAPON_FISH,

Salva e Feche.

 

Em Items.cpp

Procure :

if(readXMLString(itemAttributesNode, "value", strValue))

Abaixo de :

else if(tmpStrValue == "fist")
						it.weaponType = WEAPON_FIST;

Adicione :

else if(tmpStrValue == "fish")
						it.weaponType = WEAPON_FISH;

Salva e Feche.

 

Em Outfit.cpp

Procure :

if(readXMLInteger(configNode, "melee", intValue))

Abaixo de :

utfit.skills[SKILL_AXE] += intValue;

Adicione :

outfit.skills[SKILL_FISH] += intValue;

Procure :

if(readXMLInteger(configNode, "weapon", intValue) || readXMLInteger(configNode, "weapons", intValue))

Abaixo de :

outfit.skills[SKILL_DIST] += intValue;

Adicione :

outfit.skills[SKILL_FISH] += intValue;

Procure :

if(readXMLInteger(configNode, "meleePercent", intValue))

Abaixo de :

outfit.skillsPercent[SKILL_AXE] += intValue;

Adicione :

outfit.skillsPercent[SKILL_FISH] += intValue;

Procure :

if(readXMLInteger(configNode, "weaponPercent", intValue) || readXMLInteger(configNode, "weaponsPercent", intValue))

Abaixo de :

outfit.skillsPercent[SKILL_DIST] += intValue;

Adicione :

utfit.skillsPercent[SKILL_FISH] += intValue;

Salve e Feche.

 

Em Player.cpp

Procure:

witch(item->getWeaponType())
		{
			case WEAPON_DIST:
				if(item->getAmmoType() != AMMO_NONE)
					break;

Abaixo de :

case WEAPON_WAND:

Adicione :

case WEAPON_FISH:

Procure :

int32_t Player::getWeaponSkill(const Item* item) const
{
	if(!item)
		return getSkill(SKILL_FIST, SKILL_LEVEL);

	switch(item->getWeaponType())
	{

Abaixo de :

ase WEAPON_DIST:
			return getSkill(SKILL_DIST, SKILL_LEVEL);

Adicione :

case WEAPON_FISH:
			return getSkill(SKILL_FISH, SKILL_LEVEL);

Salve e Feche.

 

Em Spells.cpp

Procure por :

if(needWeapon)
	{
		switch(player->getWeaponType())
		{

Abaixo de :

case WEAPON_FIST:

Adicione :

case WEAPON_FISH:

Salve e Feche.

 

em Tools.cpp

Procure por :

SkillIdNames skillIdNames[] =
{

Caso quizer mudar o nome só renomear :

ou Deixa como esta

	{"fishing",		SKILL_FISH},
	{"fishing",		SKILL_FISH},

Procure por :

case SKILL_SHIELD:

Você Irá ver o Skill Fishing, Caso quizer mudar o nome só renomear :

ou Deixa como esta.

 

Salve e Feche.

 

Em Weapons.cpp

Procure por :

if(it->weaponType != WEAPON_NONE)
		{
			switch(it->weaponType)
			{

Abaixo de :

case WEAPON_FIST:

Adicione :

case WEAPON_FISH:

Procure :

switch(item->getWeaponType())

Abaixo de :

case WEAPON_FIST:
		{
			skill = SKILL_FIST;
			return true;
		}

Adicione :

case WEAPON_FISH:
		{
			skill = SKILL_FISH;
			return true;
		}

Em Condition.cpp

Procure Por :

case CONDITIONPARAM_SKILL_MELEE:
			skills[SKILL_CLUB] = skills[SKILL_AXE] = skills[SKILL_SWORD] = value;
			return true;

Modifique para :

case CONDITIONPARAM_SKILL_MELEE:
			skills[SKILL_CLUB] = skills[SKILL_AXE] = skills[SKILL_SWORD] = skills[SKILL_FISH] = value;
			return true;

Procure por :

case CONDITIONPARAM_SKILL_MELEEPERCENT:
			skillsPercent[SKILL_CLUB] = skillsPercent[SKILL_AXE] = skillsPercent[SKILL_SWORD] = std::max((int32_t)0, value);
			return true;

Modifique Para :

case CONDITIONPARAM_SKILL_MELEEPERCENT:
			skillsPercent[SKILL_CLUB] = skillsPercent[SKILL_AXE] = skillsPercent[SKILL_SWORD] = skillsPercent[SKILL_FISH] = std::max((int32_t)0, value);
			return true;

É isso ae Galera varias modificações porem Funciona Perfeitamente

 

Em /data/Items/Items.xml

 

Só modificar para fish a arma que você preferir e assim será treinado fishing em vez de qualquer outro.

 

ex :

em id="7744" article="a" name="spike sword">
        <attribute key="weight" value="5000" />
        <attribute key="defense" value="21" />
        <attribute key="attack" value="24" />
        <attribute key="weaponType" value="fish" />
        <attribute key="extradef" value="2" />
        <attribute key="elementFire" value="4" />
        <attribute key="decayTo" value="2383" />
        <attribute key="showcharges" value="1" />
    </item>

Alguem Testo ? aqui funciono Perfeito ! :D

 

Se Funciona da Rm REP+ ae Tio !

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...