This commit is contained in:
Atemo 2023-05-24 21:54:01 +02:00
parent b5413b0997
commit b0456b0e73
2 changed files with 82 additions and 95 deletions

View File

@ -4446,7 +4446,6 @@ you have maximum. Like 'heal', this will not call up any animations or effects.
*recovery <type>{,<option>,<revive_flag>{,<map name>}}; *recovery <type>{,<option>,<revive_flag>{,<map name>}};
This command will revive and fully restore the HP/SP of the selected characters. This command will revive and fully restore the HP/SP of the selected characters.
It returns 1 upon successful use.
<type> is the target, and determines the <option> parameter: <type> is the target, and determines the <option> parameter:
0: Player -> Character ID number 0: Player -> Character ID number
@ -6484,8 +6483,7 @@ the invoking character. Example can be found in the wedding script.
This function will "un-marry" the invoking character from whoever they were This function will "un-marry" the invoking character from whoever they were
married to. Both will no longer be each other's marriage partner, (at least in married to. Both will no longer be each other's marriage partner, (at least in
current SVN, which prevents the cases of multi-spouse problems). It will return current SVN, which prevents the cases of multi-spouse problems).
1 upon success or 0 if the character was not married at all.
This function will also destroy both wedding rings and send a message to both This function will also destroy both wedding rings and send a message to both
players, telling them they are now divorced. players, telling them they are now divorced.
@ -7070,9 +7068,6 @@ the invoking NPC's actions, such as using an emotion or talking.
Whichever of the both NPCs is talked to, both will show a random emotion at the Whichever of the both NPCs is talked to, both will show a random emotion at the
same time. same time.
As of r16564, command now returns 1 or 0 on success and failure.
A debug message also shows on the console when no events are triggered.
--------------------------------------- ---------------------------------------
*cmdothernpc "<npc name>","<command>"; *cmdothernpc "<npc name>","<command>";
@ -7080,8 +7075,6 @@ A debug message also shows on the console when no events are triggered.
This is simply "donpcevent <npc name>::OnCommand<command>". This is simply "donpcevent <npc name>::OnCommand<command>".
It is an approximation of official server script language's 'cmdothernpc'. It is an approximation of official server script language's 'cmdothernpc'.
Returns true if the command was executed on the other NPC successfully, false if not.
--------------------------------------- ---------------------------------------
*npctalk "<message>"{,"<NPC name>",<flag>{,<color>}}; *npctalk "<message>"{,"<NPC name>",<flag>{,<color>}};

View File

@ -11365,9 +11365,8 @@ BUILDIN_FUNC(donpcevent)
if( !npc_event_do(event) ) { if( !npc_event_do(event) ) {
struct npc_data * nd = map_id2nd(st->oid); struct npc_data * nd = map_id2nd(st->oid);
ShowDebug("NPCEvent '%s' not found! (source: %s)\n",event,nd?nd->name:"Unknown"); ShowDebug("NPCEvent '%s' not found! (source: %s)\n",event,nd?nd->name:"Unknown");
script_pushint(st, 0); return SCRIPT_CMD_FAILURE;
} else }
script_pushint(st, 1);
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_SUCCESS;
} }
@ -11382,12 +11381,10 @@ BUILDIN_FUNC(cmdothernpc) // Added by RoVeRT
safesnprintf(event,EVENT_NAME_LENGTH, "%s::%s%s",npc,script_config.oncommand_event_name,command); safesnprintf(event,EVENT_NAME_LENGTH, "%s::%s%s",npc,script_config.oncommand_event_name,command);
check_event(st, event); check_event(st, event);
if( npc_event_do(event) ){ if( !npc_event_do(event) )
script_pushint(st, true);
}else{
struct npc_data * nd = map_id2nd(st->oid); struct npc_data * nd = map_id2nd(st->oid);
ShowDebug("NPCEvent '%s' not found! (source: %s)\n", event, nd ? nd->name : "Unknown"); ShowDebug("NPCEvent '%s' not found! (source: %s)\n", event, nd ? nd->name : "Unknown");
script_pushint(st, false); return SCRIPT_CMD_FAILURE;
} }
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_SUCCESS;
@ -14119,10 +14116,9 @@ BUILDIN_FUNC(divorce)
if (!script_charid2sd(2, sd)) if (!script_charid2sd(2, sd))
return SCRIPT_CMD_FAILURE; return SCRIPT_CMD_FAILURE;
if (!pc_divorce(sd)) { if (!pc_divorce(sd))
return SCRIPT_CMD_FAILURE; return SCRIPT_CMD_FAILURE;
}
script_pushint(st,1);
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_SUCCESS;
} }
@ -14136,10 +14132,9 @@ BUILDIN_FUNC(ispartneron)
if (!script_charid2sd(2, sd)) if (!script_charid2sd(2, sd))
return SCRIPT_CMD_FAILURE; return SCRIPT_CMD_FAILURE;
if (!pc_ismarried(sd) || map_charid2sd(sd->status.partner_id) == NULL) { if (!pc_ismarried(sd) || map_charid2sd(sd->status.partner_id) == NULL)
return SCRIPT_CMD_FAILURE; script_pushint(st,0);
} else
script_pushint(st,1); script_pushint(st,1);
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_SUCCESS;
} }
@ -15622,7 +15617,6 @@ BUILDIN_FUNC(recovery)
ShowWarning("script: buildin_recovery: Invalid type %d\n", type); ShowWarning("script: buildin_recovery: Invalid type %d\n", type);
return SCRIPT_CMD_FAILURE; return SCRIPT_CMD_FAILURE;
} }
script_pushint(st,1); //Successfully executed without errors
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_SUCCESS;
} }