Code:
ITEM_BURST_ARROW = 2546
Code:
ITEM_GOLD_BOLT = 2437
Code:
ITEM_BOW = 2456
Code:
ITEM_CROSS_BOW = 2455
Code:
#ifdef SD_BURST_ARROW
if (player->isUsingBurstArrows())
burstArrow(player, attackedCreature->pos);
#endif //SD_BURST_ARROW
Code:
#ifdef GOLD_BOLT
if (player->isUsingGoldbolt())
goldbolt(player, attackedCreature->pos);
#endif //GOLD_BOLT
Code:
#ifdef SD_BURST_ARROW
class MagicEffectAreaNoExhaustionClass: public MagicEffectAreaClass {
public:
bool causeExhaustion(bool hasTarget) const { return false; }
};
void Game::burstArrow(Creature* c, const Position& pos)
{
OTSYS_THREAD_LOCK_CLASS lockClass(gameLock, "Game::burstArrow()");
std::vector<unsigned char> col;
MagicEffectAreaNoExhaustionClass runeAreaSpell;
runeAreaSpell.attackType = ATTACK_PHYSICAL;
runeAreaSpell.animationEffect = NM_ANI_BURSTARROW;
runeAreaSpell.hitEffect = NM_ME_EXPLOSION_DAMAGE;
runeAreaSpell.areaEffect = NM_ME_EXPLOSION_AREA;
runeAreaSpell.animationColor = 198; //DAMAGE_FIRE;
runeAreaSpell.drawblood = true;
runeAreaSpell.offensive = true;
/* Area of Spell */
col.push_back(1);
col.push_back(1);
col.push_back(1);
runeAreaSpell.areaVec.push_back(col);
col.clear();
col.push_back(1);
col.push_back(1);
col.push_back(1);
runeAreaSpell.areaVec.push_back(col);
col.clear();
col.push_back(1);
col.push_back(1);
col.push_back(1);
runeAreaSpell.areaVec.push_back(col);
/* hard no ? */
runeAreaSpell.direction = 1;
runeAreaSpell.minDamage = int(((c->level*g_config.BURST_DMG_LVL)+(c->maglevel*g_config.BURST_DMG_MLVL))*g_config.BURST _DMG_LO);
runeAreaSpell.maxDamage = int(((c->level*g_config.BURST_DMG_LVL)+(c->maglevel*g_config.BURST_DMG_MLVL))*g_config.BURST _DMG_HI);
creatureThrowRune(c, pos, runeAreaSpell);
}
#endif //SD_BURST_ARROW
Code:
#ifdef GOLD_BOLT
void Game::goldbolt(Creature* c, const Position& pos)
{
OTSYS_THREAD_LOCK_CLASS lockClass(gameLock, "Game::goldbolt()");
std::vector<unsigned char> col;
MagicEffectAreaNoExhaustionClass runeAreaSpell;
runeAreaSpell.attackType = ATTACK_PHYSICAL;
runeAreaSpell.animationEffect = NM_ANI_ENERGY;
runeAreaSpell.hitEffect = NM_ME_ENERGY_AREA;
runeAreaSpell.areaEffect = NM_ME_ENERGY_DAMAGE;
runeAreaSpell.animationColor = 198; //DAMAGE_FIRE;
runeAreaSpell.drawblood = true;
runeAreaSpell.offensive = true;
/* Area of Spell */
col.push_back(1);
col.push_back(1);
col.push_back(1);
runeAreaSpell.areaVec.push_back(col);
col.clear();
col.push_back(1);
col.push_back(1);
col.push_back(1);
runeAreaSpell.areaVec.push_back(col);
col.clear();
col.push_back(1);
col.push_back(1);
col.push_back(1);
runeAreaSpell.areaVec.push_back(col);
/* hard no ? */
runeAreaSpell.direction = 1;
runeAreaSpell.minDamage = int(((c->level*g_config.GOLD_DMG_LVL)+(c->maglevel*g_config.GOLD_DMG_MLVL))*g_config.GOLD_D MG_LO);
runeAreaSpell.maxDamage = int(((c->level*g_config.GOLD_DMG_LVL)+(c->maglevel*g_config.GOLD_DMG_MLVL))*g_config.GOLD_D MG_HI);
creatureThrowRune(c, pos, runeAreaSpell);
}
#endif //GOLD_BOLT
Code:
#ifdef SD_BURST_ARROW
BURST_DMG_LVL = atof(getGlobalStringField("burstarrowdmg", 1, "2.0").c_str());
BURST_DMG_MLVL = atof(getGlobalStringField("burstarrowdmg", 2, "3.0").c_str());
BURST_DMG_LO = atof(getGlobalStringField("burstarrowdmg", 3, "0.24").c_str());
BURST_DMG_HI = atof(getGlobalStringField("burstarrowdmg", 4, "0.55").c_str());
#endif //SD_BURST_ARROW
Code:
#ifdef GOLD_BOLT
GOLD_DMG_LVL = atof(getGlobalStringField("goldboltdmg", 1, "2.0").c_str());
GOLD_DMG_MLVL = atof(getGlobalStringField("goldboltdmg", 2, "3.0").c_str());
GOLD_DMG_LO = atof(getGlobalStringField("goldboltdmg", 3, "0.24").c_str());
GOLD_DMG_HI = atof(getGlobalStringField("goldboltdmg", 4, "0.55").c_str());
#endif //GOLD_BOLT
Code:
#ifdef SD_BURST_ARROW
bool Player::isUsingBurstArrows() const
{
return ((items[SLOT_LEFT] && items[SLOT_LEFT]->getID() == ITEM_BOW) ||
(items[SLOT_RIGHT] && items[SLOT_RIGHT]->getID() == ITEM_BOW)) &&
(items[SLOT_AMMO] && items[SLOT_AMMO]->getID() == ITEM_BURST_ARROW);
}
#endif //SD_BURST_ARROW
Code:
#ifdef GOLD_BOLT
bool Player::isUsingGoldbolt() const
{
return ((items[SLOT_LEFT] && items[SLOT_LEFT]->getID() == ITEM_CROSS_BOW) ||
(items[SLOT_RIGHT] && items[SLOT_RIGHT]->getID() == ITEM_CROSS_BOW)) &&
(items[SLOT_AMMO] && items[SLOT_AMMO]->getID() == ITEM_GOLD_BOLT);
}
#endif //GOLD_BOLT
Code:
#ifdef SD_BURST_ARROW
void burstArrow(Creature* c, const Position& pos);
static double BURST_DMG_LVL, BURST_DMG_MLVL, BURST_DMG_LO, BURST_DMG_HI;
#endif //SD_BURST_ARROW
Code:
#ifdef GOLD_BOLT
void goldbolt(Creature* c, const Position& pos);
static double GOLD_DMG_LVL, GOLD_DMG_MLVL, GOLD_DMG_LO, GOLD_DMG_HI;
#endif //GOLD_BOLT
Code:
#ifdef SD_BURST_ARROW
double BURST_DMG_LVL;
double BURST_DMG_MLVL;
double BURST_DMG_LO;
double BURST_DMG_HI;
#endif //SD_BURST_ARROW
Code:
#ifdef GOLD_BOLT
double GOLD_DMG_LVL;
double GOLD_DMG_MLVL;
double GOLD_DMG_LO;
double GOLD_DMG_HI;
#endif //GOLD_BOLT
Code:
#ifdef SD_BURST_ARROW
bool isUsingBurstArrows() const;
#endif //SD_BURST_ARROW
Code:
#ifdef GOLD_BOLT
bool isUsingGoldbolt() const;
#endif //GOLD_BOLT
Code:
-DGOLD_BOLT
A, i jeszcze config.lua na ko?cu trzeba doda?:
Code:
-- golden bolt settigins
-- default is from (1*lvl+5*mlvl)*0.24 to (1*lvl+5*mlvl)*0.55
goldboltdmg = {"1.0", "5.0", "0.24", "0.55"}