Administrator
Administrator
Dołączył: 16 Gru 2006
Posty: 33
Przeczytał: 0 tematów
Ostrzeżeń: 0/5
|
Wysłany: Śro 23:03, 27 Gru 2006 Temat postu: Poradnik jak zrobić fast atak |
|
|
W game.cpp znajdż:
creature->eventCheckAttacking = addEvent(makeTask(2000, std::bind2nd(std::mem_fun(&Game::checkCreatureAtta cking), id)));
I zamień na:
Player* player = dynamic_cast<Player*>(creature);
if (player->vocation == 0) {
int speed = int(g_config.NO_VOC_SPEED * 1000);
creature->eventCheckAttacking = addEvent(makeTask(speed, std::bind2nd(std::mem_fun(&Game::checkCreatureAtta cking), id)));
}
else if (player->vocation == 1) {
int speed = int(g_config.SORC_SPEED * 1000);
creature->eventCheckAttacking = addEvent(makeTask(speed, std::bind2nd(std::mem_fun(&Game::checkCreatureAtta cking), id)));
}
else if (player->vocation == 2) {
int speed = int(g_config.DRUID_SPEED * 1000);
creature->eventCheckAttacking = addEvent(makeTask(speed, std::bind2nd(std::mem_fun(&Game::checkCreatureAtta cking), id)));
}
else if (player->vocation == 3) {
int speed = int(g_config.PALLY_SPEED * 1000);
creature->eventCheckAttacking = addEvent(makeTask(speed, std::bind2nd(std::mem_fun(&Game::checkCreatureAtta cking), id)));
}
else if (player->vocation == 4) {
int speed = int(g_config.KNIGHT_SPEED * 1000);
creature->eventCheckAttacking = addEvent(makeTask(speed, std::bind2nd(std::mem_fun(&Game::checkCreatureAtta cking), id)));
}
else { //change the 2000 to whatever you want; 2000 = 2 seconds per attack
creature->eventCheckAttacking = addEvent(makeTask(2000, std::bind2nd(std::mem_fun(&Game::checkCreatureAtta cking), id)));
}
In game.h
W game.h znajdż:
void creatureTurn(Creature *creature, Direction dir);
Pod tym wklej:
static double NO_VOC_SPEED, SORC_SPEED, DRUID_SPEED, PALLY_SPEED, KNIGHT_SPEED;
W luascript.cpp znajdż:
if (lua_dofile(luaState, filename))
return false;
Pod tym wklej:
NO_VOC_SPEED = atof(getGlobalStringField("speed", 1, "2.0").c_str());
SORC_SPEED = atof(getGlobalStringField("speed", 2, "2.0").c_str());
DRUID_SPEED = atof(getGlobalStringField("speed", 3, "2.0").c_str());
PALLY_SPEED = atof(getGlobalStringField("speed", 4, "2.0").c_str());
KNIGHT_SPEED = atof(getGlobalStringField("speed", 5, "2.0").c_str());
W luascript.h znajdż:
LuaScript();
~LuaScript();
Pod tym wklej:
double NO_VOC_SPEED;
double SORC_SPEED;
double DRUID_SPEED;
double PALLY_SPEED;
double KNIGHT_SPEED;
W config.lua na samym dole wklej to:
-- speed of attack in seconds (no-voc, sorc, druid, pally, knight)
speed = {"2.5", "2.0", "2.0", "1.5", "1.0"}
Post został pochwalony 0 razy
|
|