|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Development::Feature Requests Post suggestions/feature requests here. |
 |
|
 |

11-28-2008, 05:23 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Here is what I have so far for SQL for a table. Haven't made a table myself yet, so lemme know if something looks wrong. I also included 1 example line for a fast white horse. Once this code is done, I will try to go through and create a full table for it to match what the current source code already does for all mounts.
Code:
DROP TABLE IF EXISTS `horses`;
CREATE TABLE `horses` (
`id` int(11) NOT NULL auto_increment,
`filename` varchar(32) NOT NULL,
`race` smallint(3) NOT NULL default '216',
`gender` tinyint(1) NOT NULL default '0',
`texture` tinyint(2) NOT NULL default '0',
`mountspeed` float(4,2) NOT NULL default '1.00',
`gnome_size` smallint(5) NOT NULL default '0',
`halfling_size` smallint(5) NOT NULL default '0',
`dwarf_size` smallint(5) NOT NULL default '0',
`froglok_size` smallint(5) NOT NULL default '0',
`halfelf_size` smallint(5) NOT NULL default '0',
`darkelf_size` smallint(5) NOT NULL default '0',
`woodelf_size` smallint(5) NOT NULL default '0',
`highelf_size` smallint(5) NOT NULL default '0',
`erudite_size` smallint(5) NOT NULL default '0',
`human_size` smallint(5) NOT NULL default '0',
`iksar_size` smallint(5) NOT NULL default '0',
`vahshir_size` smallint(5) NOT NULL default '0',
`barbarian_size` smallint(5) NOT NULL default '0',
`ogre_size` smallint(5) NOT NULL default '0',
`troll_size` smallint(5) NOT NULL default '0',
`notes` varchar(64) default 'Notes',
PRIMARY KEY (`id`,`filename`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `horses` VALUES ('1', 'SumHorseWhFast', '216', '0', '1', '175', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '2871 - Summon Horse');
Instead of using floats for all char sizes to allow decimals, I just set them to 5 and we can divide by 100 in the code. So, gnomesize 225 would make a horse that is 2.25 in size.
I also just made a struct for this, but am not exactly sure if this is completely right or not yet.
zonedb.h
Code:
struct Horses_Struct {
int id[11];
char filename[32];
int16 race[3];
int8 gender[1];
int8 texture[2];
float mountspeed[4];
int16 gnome_size[5];
int16 halfling_size[5];
int16 dwarf_size[5];
int16 froglok_size[5];
int16 halfelf_size[5];
int16 darkelf_size[5];
int16 woodelf_size[5];
int16 highelf_size[5];
int16 erudite_size[5];
int16 human_size[5];
int16 iksar_size[5];
int16 vahshir_size[5];
int16 barbarian_size[5];
int16 ogre_size[5];
int16 troll_size[5];
};
And, if I understand correctly, all that is left to do is to change the following to pull from the info from the new table:
horse.cpp
Code:
const NPCType *Horse::BuildHorseType(int16 spell_id) {
// Spell: 2862 Tan Rope
// Spell: 2863 Tan Leather
// Spell: 2864 Tan Silken
// Spell: 2865 Brown Chain
// Spell: 2866 Tan Ornate Chain
// Spell: 2867 White Rope
// Spell: 2868 White Leather
// Spell: 2869 White Silken
// Spell: 2870 White Chain
// Spell: 2871 White Ornate Chain
// Spell: 2872 Black Rope
// Spell: 2919 Tan Rope
// Spell: 2918 Guide
// Spell: 2917 Black Chain,
char mount_color=0;
NPCType* npc_type = new NPCType;
memset(npc_type, 0, sizeof(NPCType));
strcpy(npc_type->name,"Unclaimed_Mount"); //this should never get used
strcpy(npc_type->npc_attacks,"ABH");
npc_type->cur_hp = 1;
npc_type->max_hp = 1;
npc_type->race = 216;
npc_type->gender = (spell_id >= 3813 && spell_id <= 3832) ? 1 : 0; // Drogmor's are female horses. Yuck.
npc_type->class_ = 1;
npc_type->deity= 1;
npc_type->level = 1;
npc_type->npc_id = 0;
npc_type->loottable_id = 0;
switch(spell_id) {
case 2862:
mount_color=0; // Brown horse
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 2863:
mount_color=0; // Brown horse
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 2864:
mount_color=0; // Brown horse
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 2865:
mount_color=0; // Brown horse
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 2866:
mount_color=0; // Brown horse
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 2867:
mount_color=1; // White horse
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 2868:
mount_color=1; // White horse
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 2869:
mount_color=1; // White horse
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 2870:
mount_color=1; // White horse
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 2871:
mount_color=1; // White horse
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 2872:
mount_color=2; // Black horse
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 2873:
mount_color=2; // Black horse
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 2916:
mount_color=2; // Black horse
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 2917:
mount_color=2; // Black horse
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 2918:
mount_color=2; // Black horse
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 2919:
mount_color=3; // Tan horse
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 2920:
mount_color=3; // Tan horse
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 2921:
mount_color=3; // Tan horse
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 2922:
mount_color=3; // Tan horse
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 2923:
mount_color=3; // Tan horse
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 3813:
mount_color=0; // White drogmor
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 3814:
mount_color=0; // White drogmor
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 3815:
mount_color=0; // White drogmor
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 3816:
mount_color=0; // White drogmor
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 3817:
mount_color=0; // White drogmor
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 3818:
mount_color=1; // Black drogmor
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 3819:
mount_color=1; // Black drogmor
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 3820:
mount_color=1; // Black drogmor
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 3821:
mount_color=1; // Black drogmor
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 3822:
mount_color=1; // Black drogmor
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 3823:
mount_color=2; // Green drogmor
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 3824:
mount_color=2; // Green drogmor
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 3825:
mount_color=2; // Green drogmor
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 3826:
mount_color=2; // Green drogmor
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 3827:
mount_color=2; // Green drogmor
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 3828:
mount_color=3; // Red drogmor
npc_type->runspeed=MOUNT_SLOW1_RUN;
break;
case 3829:
mount_color=3; // Red drogmor
npc_type->runspeed=MOUNT_SLOW2_RUN;
break;
case 3830:
mount_color=3; // Red drogmor
npc_type->runspeed=MOUNT_RUN1_RUN;
break;
case 3831:
mount_color=3; // Red drogmor
npc_type->runspeed=MOUNT_RUN2_RUN;
break;
case 3832:
mount_color=3; // Red drogmor
npc_type->runspeed=MOUNT_FAST_RUN;
break;
case 2874:
npc_type->runspeed=MOUNT_FAST_RUN;
mount_color=1;
break;
case 2875:
npc_type->runspeed=MOUNT_FAST_RUN;
mount_color=2;
break;
default:
/* Message(13,"I dont know what mount spell this is! (%i)", spell_id);
mount_color= 0; // Brown horse
npc_type->walkspeed=MOUNT_SLOW1_WALK;
npc_type->runspeed=MOUNT_SLOW1_RUN;*/
LogFile->write(EQEMuLog::Error, "Unknown mount spell id %d", spell_id);
safe_delete(npc_type);
return(NULL);
break;
}
npc_type->texture = mount_color;
npc_type->light = 0;
npc_type->STR = 75;
npc_type->STA = 75;
npc_type->DEX = 75;
npc_type->AGI = 75;
npc_type->INT = 75;
npc_type->WIS = 75;
npc_type->CHA = 75;
horses_auto_delete.Insert(npc_type);
return(npc_type);
}
I am not quite sure what the best way is to pull info from the DB. I am also not yet sure on how to pull the filename from the spell to associate it with the matching filename field in the table when creating the horse.
Last edited by trevius; 11-28-2008 at 02:36 PM..
|
 |
|
 |

11-28-2008, 07:34 AM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Yeah still not liking the sizes part, we know how to grab the current size even after shrunk or grown. I doubt people would really make much use of the sizes part too.
I'll look at the code and comment more when I've had more sleep though.
|

11-28-2008, 06:28 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Ya, I don't think sizes would be required for any of the normal Horse/Drogmar/Mechboar mounts, but what if someone wanted to use a Tiger, Chokidai, Basilisk, or Alligator as a mount? Or, maybe even a boat as a mount for water or something. I am sure they would need a way to size them to players, since they aren't scaled that way by design.
It isn't required that we have the option to use other races as mounts, but I don't think it would be a bad option to have. I was mostly wanting to make it a table to allow custom speeds and the use of the mechboar mount model. I wouldn't mind seeing how well a Tiger (or whatever) might look as a mount though.
|
 |
|
 |

11-29-2008, 09:31 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I think I have everything working now. I tried messing with custom mounts and they won't work. I think the client blocks them from being used. But, the mechboars do work
In horse.cpp add these lines:
Code:
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "worldserver.h"
These were needed to get the MakeAnyLenString to compile properly. I don't know if we need all 3 of those lines, but it worked that way.
Also, replace the whole Horse::BuildHorseType section with this:
Code:
const NPCType *Horse::BuildHorseType(int16 spell_id) {
const char* FileName = spells[spell_id].teleport_zone;
char mount_color = 0;
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
if (database.RunQuery(query,MakeAnyLenString(&query, "SELECT race,gender,texture,mountspeed FROM horses WHERE filename='%s'", FileName), errbuf, &result)) {
safe_delete_array(query);
if (mysql_num_rows(result) == 1) {
row = mysql_fetch_row(result);
NPCType* npc_type = new NPCType;
memset(npc_type, 0, sizeof(NPCType));
strcpy(npc_type->name,"Unclaimed_Mount"); //this should never get used
strcpy(npc_type->npc_attacks,"ABH");
npc_type->cur_hp = 1;
npc_type->max_hp = 1;
npc_type->race = atoi(row[0]);
npc_type->gender = atoi(row[1]); // Drogmor's are female horses. Yuck.
npc_type->class_ = 1;
npc_type->deity= 1;
npc_type->level = 1;
npc_type->npc_id = 0;
npc_type->loottable_id = 0;
npc_type->texture = atoi(row[2]);
npc_type->runspeed = atof(row[3]);
mount_color = atoi(row[2]);
npc_type->light = 0;
npc_type->STR = 75;
npc_type->STA = 75;
npc_type->DEX = 75;
npc_type->AGI = 75;
npc_type->INT = 75;
npc_type->WIS = 75;
npc_type->CHA = 75;
horses_auto_delete.Insert(npc_type);
return(npc_type);
mysql_free_result(result);
}
else {
LogFile->write(EQEMuLog::Error, "No Database entry for mount: %s, check the horses table", FileName);
Message(13, "Unable to find data for mount %s", FileName);
safe_delete_array(query);
}
mysql_free_result(result);
}
else {
LogFile->write(EQEMuLog::Error, "Error in Mount query '%s': %s", query, errbuf);
safe_delete_array(query);
}
}
I will do some more testing with it. I did notice a couple cases where the wrong texture or speed was used. I am not sure why just yet. It may have just been because I was messing with the table.
Here is the dump of my semi-completed table (should match everthing that was previously in the code, and also include all mount filenames up to live):
Code:
DROP TABLE IF EXISTS `horses`;
CREATE TABLE `horses` (
`id` int(11) NOT NULL auto_increment,
`filename` varchar(32) NOT NULL,
`race` smallint(3) NOT NULL default '216',
`gender` tinyint(1) NOT NULL default '0',
`texture` tinyint(2) NOT NULL default '0',
`mountspeed` float(4,2) NOT NULL default '0.75',
`notes` varchar(64) default 'Notes',
PRIMARY KEY (`id`,`filename`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `horses` VALUES ('1', 'SumChimeraFast', '216', '0', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('2', 'SumCragslither1Fast', '436', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('3', 'SumCragslither2Fast', '436', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('4', 'SumCragslither3Fast', '436', '2', '1', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('5', 'SumHorseBlFast', '216', '0', '2', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('6', 'SumHorseBlRun1', '216', '0', '2', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('7', 'SumHorseBlRun2', '216', '0', '2', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('8', 'SumHorseBlSlow1', '216', '0', '2', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('9', 'SumHorseBlSlow2', '216', '0', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('10', 'SumHorseBrFast', '216', '0', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('11', 'SumHorseBrRun1', '216', '0', '0', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('12', 'SumHorseBrRun2', '216', '0', '0', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('13', 'SumHorseBrSlow1', '216', '0', '0', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('14', 'SumHorseBrSlow2', '216', '0', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('15', 'SumHorseTaFast', '216', '0', '3', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('16', 'SumHorseTaRun1', '216', '0', '3', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('17', 'SumHorseTaRun2', '216', '0', '3', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('18', 'SumHorseTaSlow1', '216', '0', '3', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('19', 'SumHorseTaSlow2', '216', '0', '3', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('20', 'SumHorseWhFast', '216', '0', '1', '1.75', '2871 - Summon Horse SumHorseWhFast');
INSERT INTO `horses` VALUES ('21', 'SumHorseWhRun1', '216', '0', '1', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('22', 'SumHorseWhRun2', '216', '0', '1', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('23', 'SumHorseWhSlow1', '216', '0', '1', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('24', 'SumHorseWhSlow2', '216', '0', '1', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('25', 'SumKirin0Fast', '356', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('26', 'SumKirin2Fast', '356', '2', '1', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('27', 'SumLizardBlkFast', '216', '1', '1', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('28', 'SumLizardBlkRun1', '216', '1', '1', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('29', 'SumLizardBlkRun2', '216', '1', '1', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('30', 'SumLizardBlkSlow1', '216', '1', '1', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('31', 'SumLizardBlkSlow2', '216', '1', '1', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('32', 'SumLizardGrnFast', '216', '1', '2', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('33', 'SumLizardGrnRun1', '216', '1', '2', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('34', 'SumLizardGrnRun2', '216', '1', '2', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('35', 'SumLizardGrnSlow1', '216', '1', '2', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('36', 'SumLizardGrnSlow2', '216', '1', '2', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('37', 'SumLizardRedFast', '216', '1', '3', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('38', 'SumLizardRedRun1', '216', '1', '3', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('39', 'SumLizardRedRun2', '216', '1', '3', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('40', 'SumLizardRedSlow1', '216', '1', '3', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('41', 'SumLizardRedSlow2', '216', '1', '3', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('42', 'SumLizardWhtFast', '216', '1', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('43', 'SumLizardWhtRun1', '216', '1', '0', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('44', 'SumLizardWhtRun2', '216', '1', '0', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('45', 'SumLizardWhtSlow1', '216', '1', '0', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('46', 'SumLizardWhtSlow2', '216', '1', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('47', 'SumNightmareFast', '42', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('48', 'SumPuma1Fast', '63', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('49', 'SumPuma3Fast', '63', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('50', 'SumRoboboar', '472', '2', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('51', 'SumRoboboarFast', '472', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('52', 'SumRoboboarRun1', '472', '2', '0', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('53', 'SumRoboboarRun2', '472', '2', '0', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('54', 'SumRoboboarSlow2', '472', '2', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('55', 'SumUnicornFast', '216', '0', '1', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('56', 'SumWarHorseBlFast', '216', '0', '2', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('57', 'SumWarHorseBlRun1', '216', '0', '2', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('58', 'SumWarHorseBlRun2', '216', '0', '2', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('59', 'SumWarHorseBlSlow1', '216', '0', '2', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('60', 'SumWarHorseBlSlow2', '216', '0', '2', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('61', 'SumWarHorseBrFast', '216', '0', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('62', 'SumWarHorseBrRun1', '216', '0', '0', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('63', 'SumWarHorseBrRun2', '216', '0', '0', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('64', 'SumWarHorseBrSlow1', '216', '0', '0', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('65', 'SumWarHorseBrSlow2', '216', '0', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('66', 'SumWarHorseTaFast', '216', '0', '3', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('67', 'SumWarHorseTaRun1', '216', '0', '3', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('68', 'SumWarHorseTaRun2', '216', '0', '3', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('69', 'SumWarHorseTaSlow1', '216', '0', '3', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('70', 'SumWarHorseTaSlow2', '216', '0', '3', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('71', 'SumWarHorseWhFast', '216', '0', '1', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('72', 'SumWarHorseWhRun1', '216', '0', '1', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('73', 'SumWarHorseWhRun2', '216', '0', '1', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('74', 'SumWarHorseWhSlow1', '216', '0', '1', '0.75', 'Notes');
INSERT INTO `horses` VALUES ('75', 'SumWarHorseWhSlow2', '216', '0', '1', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('76', 'SumWorgFastClaimDigital', '42', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('77', 'SumWorgFastClaimRetailBox', '42', '2', '0', '1.75', 'Notes');
INSERT INTO `horses` VALUES ('78', 'SumWorgRun1ClaimDigital', '42', '2', '0', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('79', 'SumWorgRun1ClaimRetailBox', '42', '2', '0', '1.25', 'Notes');
INSERT INTO `horses` VALUES ('80', 'SumWorgRun2ClaimDigital', '42', '2', '0', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('81', 'SumWorgRun2ClaimRetailBox', '42', '2', '0', '1.50', 'Notes');
INSERT INTO `horses` VALUES ('82', 'SumWorgSlow2ClaimDigital', '42', '2', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('83', 'SumWorgSlow2ClaimRetailBox', '42', '2', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('84', 'TestHorseA', '216', '0', '0', '1.00', 'Notes');
INSERT INTO `horses` VALUES ('85', 'TestWarHorseA\r\nTestHorseA\r\nTestH', '216', '0', '0', '1.00', 'Notes');
Last edited by trevius; 12-01-2008 at 08:45 AM..
|
 |
|
 |
 |
|
 |

11-29-2008, 10:09 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
It looks like we will need to change this as well:
effects.cpp
Code:
void EntityList::AEAttack(Mob *attacker, float dist, int Hand, int count) {
//Dook- Will need tweaking, currently no pets or players or horses
LinkedListIterator<Mob*> iterator(mob_list);
Mob *curmob;
float dist2 = dist * dist;
int hit = 0;
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) {
curmob = iterator.GetData();
if(curmob->IsNPC()
&& curmob != attacker //this is not needed unless NPCs can use this
&&(attacker->IsAttackAllowed(curmob))
&& curmob->GetRace() != 216 /* dont attack horses */
&& (curmob->DistNoRoot(*attacker) <= dist2)
) {
attacker->Attack(curmob, Hand);
hit++;
if(count != 0 && hit >= count)
return;
}
}
}
I think we can just change that line to this:
Code:
&& curmob->GetRace() != 216 && curmob->GetRace() != 472 /* dont attack horses */
This is to keep AEs from hitting mounts. I will look through for more possible issues. After further testing, all seems well accept for the slowest mounts aren't moving. They are set to 0.75 speed, so maybe that has something to do with it.
|
 |
|
 |
 |
|
 |

11-30-2008, 08:17 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
There are still 2 issues holding me back from being able to get this added to SVN. The first issue is that the 0.75 speed mounts don't move at all. It almost seems like it is setting the speed to 0 for some reason. It worked fine for the old way horses were done, but doesn't seem to work in the new way.
The second issue is that if you #cast the spell, the mount summons almost instantly, but if you try to use the actual bridles, it delays the spell for a while. The mount does still cast, but it takes probably 5 or 10 seconds after the spell finishes casting before the mount actually gets summoned. I am not sure what is causing this extra cast time yet. It almost seems like the displayed cast time and actual cast time settings for the bridles are not the same times. But, checking the items show that they are.
If anyone wants to check this out and/or maybe give a little help, it would be appreciated. I think this is mostly done. Other than those 2 issues, the rest seems to work great.
|
 |
|
 |
 |
|
 |

11-30-2008, 04:25 PM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Why did you not just store mountspeed as a float? Why do this extra work when you could just do:
Code:
npc_type->runspeed = atof(row[3])
Here's an explanation of what's going wrong with your runspeed by doing it this way:
Code:
npc_type->runspeed = mountspeed / 100;
if it's 125:
npc_type->runspeed = 125 / 100;
npc_type->runspeed = 1
if it's 100:
npc_type->runspeed = 100 / 100;
npc_type->runspeed = 1
if it's 75:
npc_type->runspeed = 75 / 100;
npc_type->runspeed = 0
None of them are floats and ints will not do any rounding for you if it comes up with a partial during a divide it is dropped. Unless you cast the variables to float first you're not going to get anywhere.
Also there's no reason to assign temp variables to hold the information from db as you don't do anything else with it, you're plugging it straight into the NPCType. Waste of time and memory however small it may be.
Last edited by KLS; 12-01-2008 at 12:33 AM..
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 07:22 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |