Initial implementation of pet evolution system + Pet DB conversion to YAML (#3544)
* Implemented official pet evolution system * Added evolved pets to pet database * Corrected various pet system mechanics * Migrated pet database to YAML format and the converter from CSV format Thanks to @Lemongrass3110 @aleos89 and @Atemo for their suggestions and additional fixes
This commit is contained in:
committed by
GitHub
parent
e4b41ef7e0
commit
ac558d7c1e
@@ -8638,7 +8638,7 @@ BUILDIN_FUNC(getbrokenid)
|
||||
|
||||
num = script_getnum(st,2);
|
||||
for(i = 0; i < MAX_INVENTORY; i++) {
|
||||
if(sd->inventory.u.items_inventory[i].attribute) {
|
||||
if( sd->inventory.u.items_inventory[i].card[0] != CARD0_PET && sd->inventory.u.items_inventory[i].attribute ){
|
||||
brokencounter++;
|
||||
if(num == brokencounter){
|
||||
id = sd->inventory.u.items_inventory[i].nameid;
|
||||
@@ -8667,7 +8667,7 @@ BUILDIN_FUNC(repair)
|
||||
|
||||
num = script_getnum(st,2);
|
||||
for(i = 0; i < MAX_INVENTORY; i++) {
|
||||
if(sd->inventory.u.items_inventory[i].attribute) {
|
||||
if( sd->inventory.u.items_inventory[i].card[0] != CARD0_PET && sd->inventory.u.items_inventory[i].attribute ){
|
||||
repaircounter++;
|
||||
if(num == repaircounter) {
|
||||
sd->inventory.u.items_inventory[i].attribute = 0;
|
||||
@@ -8695,8 +8695,7 @@ BUILDIN_FUNC(repairall)
|
||||
|
||||
for(i = 0; i < MAX_INVENTORY; i++)
|
||||
{
|
||||
if(sd->inventory.u.items_inventory[i].nameid && sd->inventory.u.items_inventory[i].attribute)
|
||||
{
|
||||
if( sd->inventory.u.items_inventory[i].nameid && sd->inventory.u.items_inventory[i].card[0] != CARD0_PET && sd->inventory.u.items_inventory[i].attribute ){
|
||||
sd->inventory.u.items_inventory[i].attribute = 0;
|
||||
clif_produceeffect(sd,0,sd->inventory.u.items_inventory[i].nameid);
|
||||
repaircounter++;
|
||||
@@ -10110,13 +10109,12 @@ BUILDIN_FUNC(makepet)
|
||||
{
|
||||
struct map_session_data* sd;
|
||||
uint16 mob_id;
|
||||
struct s_pet_db* pet;
|
||||
|
||||
if( !script_rid2sd(sd) )
|
||||
return SCRIPT_CMD_FAILURE;
|
||||
|
||||
mob_id = script_getnum(st,2);
|
||||
pet = pet_db(mob_id);
|
||||
std::shared_ptr<s_pet_db> pet = pet_db.find(mob_id);
|
||||
|
||||
if( !pet ){
|
||||
ShowError( "buildin_makepet: failed to create a pet with mob id %hu\n", mob_id);
|
||||
@@ -10124,7 +10122,10 @@ BUILDIN_FUNC(makepet)
|
||||
}
|
||||
|
||||
sd->catch_target_class = mob_id;
|
||||
intif_create_pet( sd->status.account_id, sd->status.char_id, pet->class_, mob_db(pet->class_)->lv, pet->EggID, 0, pet->intimate, 100, 0, 1, pet->jname );
|
||||
|
||||
struct mob_db* mdb = mob_db(pet->class_);
|
||||
|
||||
intif_create_pet( sd->status.account_id, sd->status.char_id, pet->class_, mdb->lv, pet->EggID, 0, pet->intimate, 100, 0, 1, mdb->jname );
|
||||
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user