Odp: Pare przyk?adowych kod?w / Tibia 7.6
1. Powiedzmy ?e blue robe
const76.h pod
[CPP]ITEM_WAND_OF_DRAGONBREATH = 2191,[/C]]
dodaj
[CPP]ITEM_BLUEROBE = 2656,[/CPP]
game.cpp pod
[CPP] if (damage != 0)
{
if (me->attackType & ATTACK_MANADRAIN)
{
manaDamage = std::min(damage, targetCreature->mana);
targetCreature->drainMana(manaDamage);
damage = 0;
}
else
{
game->creatureApplyDamage(targetCreature, damage, damage, manaDamage
#ifdef YUR_PVP_ARENA
, (pvpArena? &arenaLosers : NULL)
#endif //YUR_PVP_ARENA
);
}[/CPP]
dodaj
[CPP] if(attackPlayer && attackPlayer->getItem(SLOT_ARMOR) && attackPlayer->getItem(SLOT_ARMOR)->getID() == ITEM_BLUEROBE){
double newdamage = damage*g_config.BLUE_ROBE/100.0;
damage += (int)newdamage;
}[/CPP]
luascript.cpp pod
[CPP]RANGE_INFERNO = atoi(getGlobalStringField("wandrange", 5, "3").c_str());[/CPP]
dodaj
[CPP]BLUE_ROBE = getGlobalNumber("bluerobe",20);[/CPP]
luascript.h pod
[CPP]int RANGE_TEMPEST[/CPP]
dodaj
[CPP]int BLUE_ROBE;[/CPP]
do config.lua
[LUA]-- O ile % zwiekszone beda obrazenia przy noszeniu Blue Robe?
bluerobe = 3[/LUA]
3. analogicznie do punkty pierwszego, tylko pozmieniaj sobie deklaracje i w game.cpp zamiast tamtego kawa?ka kodu dodaj pod
[CPP] if (ring && ring->getCharges() > 0)
{
if (ring->getID() == ITEM_MIGHT_RING)
{
newDamage *= 0.9;
ring->useCharge();
}
if (ring->getCharges() <= 0)
player->removeItemInventory(SLOT_RING);
}[/CPP]
dodaj
[CPP] if(player && player->getItem(SLOT_ARMOR) && player->getItem(SLOT_ARMOR)->getID() == ITEM_BLUEROBE)
{
newDamage *= 1.0 - (double)g_config.BLUEROBEABS/100.0;
}[/CPP]
4.w player.cpp pod
[CPP] if(vocation != VOCATION_NONE){
if(sex == PLAYERSEX_FEMALE)
s << " She";
else
s << " He";
#ifdef YUR_PREMIUM_PROMOTION
if (isPromoted())
s << " is "<< g_config.PROMOTED_VOCATIONS[(int)vocation] << ".";
else
#endif //YUR_PREMIUM_PROMOTION
s << " is "<< g_config.VOCATIONS[(int)vocation] << ".";
}
}[/CPP]
DODAJ
[CPP] switch(access)
{
case 0:
break;
case 1:
if(self)
if(sex == PLAYERSEX_FEMALE) //patrzysz na siebie
s << "\n...::: Tutorka :::...\n";
else
s << "\n...::: Tutor :::...\n";
else
{
if(sex == PLAYERSEX_FEMALE) //patrzysz na niego
s << "\n...::: Tutorka :::...\n";
else
s << "\n...::: Tutor :::...\n";
}
break;
case 2:
if(self)
if(sex == PLAYERSEX_FEMALE) //patrzysz na siebie
s << "\n...::: Senior Tutorka :::...\n";
else
s << "\n...::: Senior Tutor :::...\n";
else
{
if(sex == PLAYERSEX_FEMALE) //patrzysz na niego
s << "\n...::: Senior Tutorka :::...\n";
else
s << "\n...::: Senior Tutor :::...\n";
}
break;
case 3:
if(self)
if(sex == PLAYERSEX_FEMALE) //patrzysz na siebie
s << "\n...::: GameMasterka :::...\n";
else
s << "\n...::: GameMaster :::...\n";
else
{
if(sex == PLAYERSEX_FEMALE) //patrzysz na niego
s << "\n...::: GameMasterka :::...\n";
else
s << "\n...::: GameMaster :::...\n";
}
break;
case 4:
if(self)
if(sex == PLAYERSEX_FEMALE) //patrzysz na siebie
s << "\n...::: Senior GameMasterka :::...\n";
else
s << "\n...::: Senior GameMasterka :::...\n";
else
{
if(sex == PLAYERSEX_FEMALE) //patrzysz na niego
s << "\n...::: Senior GameMasterka :::...\n";
else
s << "\n...::: Senior GameMasterka :::...\n";
}
break;
case 5:
if(self)
if(sex == PLAYERSEX_FEMALE) //patrzysz na siebie
s << "\n...::: Hosterka :::...\n";
else
s << "\n...::: Hoster :::...\n";
else
{
if(sex == PLAYERSEX_FEMALE) //patrzysz na niego
s << "\n...::: Hosterka :::...\n";
else
s << "\n...::: Hoster :::...\n";
}
break;
}[/CPP]