What's new

Kod na Set.

Status
Not open for further replies.

Piaskillers

Active User
Joined
Dec 23, 2008
Messages
95
Reaction score
6
Przedstawiam kod na Set, kt?ry dodaje obra?enia magiczne w po??czeniu ze sob?. Set jest zrobiony na przyk?adzie Sapphire Setu znanego z APO.
W const76.h pod:
PHP:
    ITEM_WAND_OF_DRAGONBREATH    = 2191,
Dodajemy:
PHP:
    ITEM_SARMOR = 2503,
    ITEM_SHELMET = 2501,
    ITEM_SLEGS  = 2504,
W game.cpp pod:
PHP:
            if (me->attackType & ATTACK_MANADRAIN)
            {
                manaDamage = std::min(damage, targetCreature->mana);
                targetCreature->drainMana(manaDamage);
                damage = 0;
            }
            else
#endif //YUR_DRAINS
Dodajemy:
PHP:
if(attackPlayer && attackPlayer->getItem(SLOT_HEAD) && attackPlayer->getItem(SLOT_HEAD)->getID() == ITEM_SHELMET && attackPlayer->getItem(SLOT_ARMOR) && attackPlayer->getItem(SLOT_ARMOR)->getID() == ITEM_SARMOR && attackPlayer->getItem(SLOT_LEGS) && attackPlayer->getItem(SLOT_LEGS)->getID() == ITEM_SLEGS) 
{ 
double newdamage = damage*g_config.SAPPHIRE_SET/100.0; 
damage += (int)newdamage; 
}
Potem w luascript.cpp pod:
PHP:
    MANA_INFERNO = atoi(getGlobalStringField("wandmana", 5, "13").c_str());
Dodajemy:
PHP:
    SAPPHIRE_SET = getGlobalNumber("sapphireset",20);
Nastepnie w luascript.h pod:
PHP:
    int MANA_INFERNO;
Dodajemy:
PHP:
    int SAPPHIRE_SET;
I w config.lua dodajemy:
PHP:
sapphireset = 14
Teraz wystarczy przebudowa? projekt.
Testowane na YurOTS 0.9.4f
 
Status
Not open for further replies.
Top