Changeset 178
- Timestamp:
- 12/29/09 04:02:50 (8 months ago)
- Location:
- eoserv/trunk
- Files:
-
- 1 added
- 21 modified
-
Makefile.all (modified) (1 diff)
-
config.extra.ini (modified) (1 diff)
-
config.ini (modified) (1 diff)
-
data/formulas.ini (modified) (1 diff)
-
project/mingw.cbp (modified) (1 diff)
-
src/character.cpp (modified) (3 diffs)
-
src/character.hpp (modified) (4 diffs)
-
src/eoclient.cpp (modified) (1 diff)
-
src/eoclient.hpp (modified) (1 diff)
-
src/eoserver.cpp (modified) (1 diff)
-
src/handlers/Bank.cpp (modified) (1 diff)
-
src/handlers/Barber.cpp (added)
-
src/handlers/Chest.cpp (modified) (1 diff)
-
src/handlers/Item.cpp (modified) (3 diffs)
-
src/handlers/Jukebox.cpp (modified) (1 diff)
-
src/handlers/Shop.cpp (modified) (1 diff)
-
src/handlers/Walk.cpp (modified) (1 diff)
-
src/main.cpp (modified) (1 diff)
-
src/map.cpp (modified) (3 diffs)
-
src/npc.cpp (modified) (1 diff)
-
src/packet.cpp (modified) (1 diff)
-
src/packet.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
eoserv/trunk/Makefile.all
r171 r178 63 63 $(OBJDIR)/handlers/Attack.o \ 64 64 $(OBJDIR)/handlers/Bank.o \ 65 $(OBJDIR)/handlers/Barber.o \ 65 66 $(OBJDIR)/handlers/Board.o \ 66 67 $(OBJDIR)/handlers/Book.o \ -
eoserv/trunk/config.extra.ini
r172 r178 68 68 CreateMaxSkin = 3 69 69 70 ## BarberBase (number) 71 # Base price for a haircut 72 BarberBase = 0 73 74 ## BarberStep (number) 75 # Cost per level for a haircut 76 # A level 0 is charged the same as a level 1 77 BarberStep = 200 78 70 79 ## BankUpgradeBase (number) 71 80 # Base cost for a bank upgrade -
eoserv/trunk/config.ini
r177 r178 130 130 ArenasFile = ./data/arenas.ini 131 131 132 ## For umasFile (string)133 # File containing forumulas132 ## FormulasFile (string) 133 # File containing stat/combat/class formulas 134 134 FormulasFile = ./data/formulas.ini 135 135 -
eoserv/trunk/data/formulas.ini
r177 r178 15 15 16 16 # Hit rate and damage 17 hit_rate = 0.8 1.2 critical ? 200 accuracy / + 200 modifier target_evade * / +0.2 max 1.0 min17 hit_rate = 200 modifier target_evade * / 0.8 1.2 critical ? 200 accuracy / + - 0.2 max 1.0 min 18 18 damage = 3 target_armor / modifier * damage - 0.1 damage * ceil max 1 1.5 critical ? * 19 19 -
eoserv/trunk/project/mingw.cbp
r171 r178 181 181 <Unit filename="..\src\handlers\Attack.cpp" /> 182 182 <Unit filename="..\src\handlers\Bank.cpp" /> 183 <Unit filename="..\src\handlers\Barber.cpp" /> 183 184 <Unit filename="..\src\handlers\Board.cpp" /> 184 185 <Unit filename="..\src\handlers\Book.cpp" /> -
eoserv/trunk/src/character.cpp
r177 r178 139 139 this->x = GetRow<int>(row, "x"); 140 140 this->y = GetRow<int>(row, "y"); 141 this->direction = GetRow<int>(row, "direction");141 this->direction = static_cast<Direction>(GetRow<int>(row, "direction")); 142 142 143 143 this->spawnmap = GetRow<int>(row, "spawnmap"); … … 184 184 this->shop_npc = 0; 185 185 this->bank_npc = 0; 186 this->barber_npc = 0; 186 187 187 188 this->next_arena = 0; … … 641 642 this->shop_npc = 0; 642 643 this->bank_npc = 0; 644 this->barber_npc = 0; 643 645 this->jukebox_open = true; 644 646 -
eoserv/trunk/src/character.hpp
r177 r178 75 75 unsigned char hairstyle, haircolor; 76 76 short mapid; 77 unsigned char x, y, direction; 77 unsigned char x, y; 78 Direction direction; 78 79 short spawnmap; 79 80 unsigned char spawnx, spawny; … … 111 112 NPC *shop_npc; 112 113 NPC *bank_npc; 114 NPC *barber_npc; 113 115 bool jukebox_open; 114 116 … … 209 211 SCRIPT_REGISTER_VARIABLE("uint8", x); 210 212 SCRIPT_REGISTER_VARIABLE("uint8", y); 211 SCRIPT_REGISTER_VARIABLE(" uint8", direction);213 SCRIPT_REGISTER_VARIABLE("Direction", direction); 212 214 SCRIPT_REGISTER_VARIABLE("int16", spawnmap); 213 215 SCRIPT_REGISTER_VARIABLE("uint8", spawnx); … … 253 255 SCRIPT_REGISTER_VARIABLE("NPC @", shop_npc); 254 256 SCRIPT_REGISTER_VARIABLE("NPC @", bank_npc); 257 SCRIPT_REGISTER_VARIABLE("NPC @", barber_npc); 255 258 SCRIPT_REGISTER_VARIABLE("bool", jukebox_open); 256 259 SCRIPT_REGISTER_VARIABLE("WarpAnimation", warp_anim); -
eoserv/trunk/src/eoclient.cpp
r175 r178 116 116 CLIENT_F_HANDLE(PACKET_BANK,Bank); 117 117 CLIENT_F_HANDLE(PACKET_LOCKER,Locker); 118 CLIENT_F_HANDLE(PACKET_BARBER,Barber); 118 119 CLIENT_F_HANDLE(PACKET_GUILD,Guild); 119 120 CLIENT_F_HANDLE(PACKET_SIT,Sit); -
eoserv/trunk/src/eoclient.hpp
r175 r178 153 153 CLIENT_F_FUNC(Bank); 154 154 CLIENT_F_FUNC(Locker); 155 CLIENT_F_FUNC(Barber); 155 156 CLIENT_F_FUNC(Guild); 156 157 CLIENT_F_FUNC(Sit); -
eoserv/trunk/src/eoserver.cpp
r176 r178 106 106 QUEUE_F_HANDLE(PACKET_BANK,Bank); 107 107 QUEUE_F_HANDLE(PACKET_LOCKER,Locker); 108 QUEUE_F_HANDLE(PACKET_BARBER,Barber); 108 109 QUEUE_F_HANDLE(PACKET_GUILD,Guild); 109 110 QUEUE_F_HANDLE(PACKET_SIT,Sit); -
eoserv/trunk/src/handlers/Bank.cpp
r173 r178 20 20 { 21 21 if (this->state < EOClient::Playing) return false; 22 CLIENT_QUEUE_ACTION(0.0) 22 23 23 24 short id = reader.GetShort(); -
eoserv/trunk/src/handlers/Chest.cpp
r171 r178 119 119 { 120 120 if (this->state < EOClient::Playing) return false; 121 CLIENT_QUEUE_ACTION(0.0) 121 122 122 123 int x = reader.GetChar(); -
eoserv/trunk/src/handlers/Item.cpp
r177 r178 20 20 { 21 21 if (this->state < EOClient::PlayingModal) return false; 22 CLIENT_QUEUE_ACTION(0.0) 22 23 23 24 int id = reader.GetShort(); … … 162 163 { 163 164 if (this->state < EOClient::PlayingModal) return false; 165 CLIENT_QUEUE_ACTION(0.0) 164 166 165 167 int id = reader.GetShort(); … … 262 264 { 263 265 if (this->state < EOClient::Playing) return false; 266 CLIENT_QUEUE_ACTION(0.0) 264 267 265 268 int uid = reader.GetShort(); -
eoserv/trunk/src/handlers/Jukebox.cpp
r172 r178 18 18 { 19 19 if (this->state < EOClient::PlayingModal) return false; 20 CLIENT_QUEUE_ACTION(0.0) 20 21 21 22 unsigned char x = reader.GetChar(); -
eoserv/trunk/src/handlers/Shop.cpp
r171 r178 134 134 { 135 135 if (this->state < EOClient::Playing) return false; 136 CLIENT_QUEUE_ACTION(0.0) 136 137 137 138 short id = reader.GetShort(); -
eoserv/trunk/src/handlers/Walk.cpp
r177 r178 52 52 this->player->character->shop_npc = 0; 53 53 this->player->character->bank_npc = 0; 54 this->player->character->barber_npc = 0; 54 55 this->player->character->jukebox_open = true; 55 56 if (!this->player->character->Walk(direction)) -
eoserv/trunk/src/main.cpp
r177 r178 370 370 eoserv_config_default(config, "CriticalRate" , 0.08); 371 371 eoserv_config_default(config, "SpawnRate" , 1.0); 372 eoserv_config_default(config, "BarberBase" , 0); 373 eoserv_config_default(config, "BarberStep" , 200); 372 374 eoserv_config_default(config, "BankUpgradeBase" , 1000); 373 375 eoserv_config_default(config, "BankUpgradeStep" , 1000); -
eoserv/trunk/src/map.cpp
r177 r178 1269 1269 double rand = util::rand(0.0, 1.0); 1270 1270 // Checks if target is facing you 1271 bool critical = std::abs( npc->direction- from->direction) != 2 || rand < static_cast<double>(this->world->config["CriticalRate"]);1271 bool critical = std::abs(int(npc->direction) - from->direction) != 2 || rand < static_cast<double>(this->world->config["CriticalRate"]); 1272 1272 1273 1273 std::map<std::string, double> formula_vars; … … 1282 1282 double hit_rate = rpn_eval(rpn_parse(this->world->formulas_config["hit_rate"]), formula_vars); 1283 1283 1284 printf("damage %i / %g > %g", amount, rand, hit_rate); 1285 1284 1286 if (rand > hit_rate) 1285 1287 { … … 1352 1354 double rand = util::rand(0.0, 1.0); 1353 1355 // Checks if target is facing you 1354 bool critical = std::abs( character_ptr->direction- from->direction) != 2 || rand < static_cast<double>(this->world->config["CriticalRate"]);1356 bool critical = std::abs(int(character_ptr->direction) - from->direction) != 2 || rand < static_cast<double>(this->world->config["CriticalRate"]); 1355 1357 1356 1358 std::map<std::string, double> formula_vars; -
eoserv/trunk/src/npc.cpp
r177 r178 727 727 double rand = util::rand(0.0, 1.0); 728 728 // Checks if target is facing you 729 bool critical = std::abs( target->direction- this->direction) != 2 || rand < static_cast<double>(this->map->world->config["CriticalRate"]);729 bool critical = std::abs(int(target->direction) - this->direction) != 2 || rand < static_cast<double>(this->map->world->config["CriticalRate"]); 730 730 731 731 std::map<std::string, double> formula_vars; -
eoserv/trunk/src/packet.cpp
r175 r178 48 48 case PACKET_BANK: return "Bank"; 49 49 case PACKET_LOCKER: return "Locker"; 50 case PACKET_BARBER: return "Barber"; 50 51 case PACKET_GUILD: return "Guild"; 51 52 case PACKET_SIT: return "Sit"; -
eoserv/trunk/src/packet.hpp
r175 r178 45 45 PACKET_BANK = 36, 46 46 PACKET_LOCKER = 37, 47 PACKET_BARBER = 38, 47 48 PACKET_GUILD = 39, 48 49 PACKET_SIT = 41,
