summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-10 17:07:35 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-10 17:07:35 +0000
commite6d726f486b00d443320269a96a0e6d9a12d8d38 (patch)
treeb2fc96e5b687976248ecfce71ed049464b007354 /src/map/script.c
parent9343f6e46de1221a00e136c69acc2762c681ba62 (diff)
downloadhercules-e6d726f486b00d443320269a96a0e6d9a12d8d38.tar.gz
hercules-e6d726f486b00d443320269a96a0e6d9a12d8d38.tar.bz2
hercules-e6d726f486b00d443320269a96a0e6d9a12d8d38.tar.xz
hercules-e6d726f486b00d443320269a96a0e6d9a12d8d38.zip
- Removed bonus bAddEffWhenHitShort as it is unneeded and unused.
- Corrected getpetinfo so it actually returns "null" when there's no pet and you request the name (the docs state it so). - Also cleaned up a bit getpetinfo - Added gethominfo (which behaves in the same way as getpetinfo). - The 'maxcount' skill_db field now can store independant values per skill-level, required for Kamaitachi since it uses different range values per level. - Corrected bonus3 bAutoSpell(WhenHit) to select target enemy (rather than self) for skills with inf self and inf2 'don't target self' (aka: auto-select target skills). - Corrected map_foreachinpath to do a wall check for targets beyond the initially selected tile. - Corrected Kamaitachi's range to be 9, and the path range to be 4+SkillLv git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11169 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c73
1 files changed, 57 insertions, 16 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 7e36818e9..a5dc7696b 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11062,27 +11062,68 @@ BUILDIN_FUNC(recovery)
BUILDIN_FUNC(getpetinfo)
{
TBL_PC *sd=script_rid2sd(st);
- struct pet_data *pd;
+ TBL_PET *pd;
int type=script_getnum(st,2);
+
+ if(!sd || !sd->pd) {
+ if (type == 2)
+ script_pushconststr(st,"null");
+ else
+ script_pushint(st,0);
+ return 0;
+ }
+ pd = sd->pd;
+ switch(type){
+ case 0: script_pushint(st,pd->pet.pet_id); break;
+ case 1: script_pushint(st,pd->pet.class_); break;
+ case 2: script_pushstr(st,aStrdup(pd->pet.name)); break;
+ case 3: script_pushint(st,pd->pet.intimate); break;
+ case 4: script_pushint(st,pd->pet.hungry); break;
+ case 5: script_pushint(st,pd->pet.rename_flag); break;
+ default:
+ script_pushint(st,0);
+ break;
+ }
+ return 0;
+}
- if(sd && sd->status.pet_id && sd->pd){
- pd = sd->pd;
- switch(type){
- case 0: script_pushint(st,sd->status.pet_id); break;
- case 1: script_pushint(st,pd->pet.class_); break;
- case 2: script_pushstr(st,aStrdup(pd->pet.name)); break;
- case 3: script_pushint(st,pd->pet.intimate); break;
- case 4: script_pushint(st,pd->pet.hungry); break;
- case 5: script_pushint(st,pd->pet.rename_flag); break;
- default:
- script_pushint(st,0);
- break;
- }
- }else{
- script_pushint(st,0);
+/*==========================================
+ * Get your homunculus info: gethominfo(n)
+ * n -> 0:hom_id 1:class 2:name
+ * 3:friendly 4:hungry, 5: rename flag.
+ * 6: level
+ *------------------------------------------*/
+BUILDIN_FUNC(gethominfo)
+{
+ TBL_PC *sd=script_rid2sd(st);
+ TBL_HOM *hd;
+ int type=script_getnum(st,2);
+
+ hd = sd?sd->hd:NULL;
+ if(!merc_is_hom_active(hd))
+ {
+ if (type == 2)
+ script_pushconststr(st,"null");
+ else
+ script_pushint(st,0);
+ return 0;
+ }
+
+ switch(type){
+ case 0: script_pushint(st,hd->homunculus.hom_id); break;
+ case 1: script_pushint(st,hd->homunculus.class_); break;
+ case 2: script_pushstr(st,aStrdup(hd->homunculus.name)); break;
+ case 3: script_pushint(st,hd->homunculus.intimacy); break;
+ case 4: script_pushint(st,hd->homunculus.hunger); break;
+ case 5: script_pushint(st,hd->homunculus.rename_flag); break;
+ case 6: script_pushint(st,hd->homunculus.level); break;
+ default:
+ script_pushint(st,0);
+ break;
}
return 0;
}
+
/*==========================================
* Shows wether your inventory(and equips) contain
selected card or not.