utofaery Posted April 23, 2015 Posted April 23, 2015 Well here goes. I was hoping there could be something like read homunculus S previous form before mutation so that I could make quest script from that. Eg. Bayeri from Amistr And so on. Will be glad if this can be added in thank you.
Aleos Posted April 23, 2015 Posted April 23, 2015 You can already do this. Just do a query on the 'homunculus' table and grab the `prev_class` to get the ID of the homunculus' previous class.
utofaery Posted April 23, 2015 Author Posted April 23, 2015 You can already do this. Just do a query on the 'homunculus' table and grab the `prev_class` to get the ID of the homunculus' previous class. Sir if you will please give me example on how I would do that. I am not good at all at sql than I could create npc script which sell stuff. Something like I have trigger the npc script then script checks for my homunculus prev_class through query_sql then the script would go on if prev_class a then action 1 ...
Aleos Posted April 23, 2015 Posted April 23, 2015 query_sql "SELECT `prev_class` FROM `homunculus` WHERE `char_id` = "+ getcharid(0) +" LIMIT 1", .@prev_class; if (.@prev_class == 6001) { mes "I was a small Lif!"; close; } Something like that should do fine.
utofaery Posted April 24, 2015 Author Posted April 24, 2015 (edited) Thank you for your helping hand, Aleos. prontera,154,182,4 script SQLTest 90,{ query_sql "SELECT `prev_class` FROM `homunculus` WHERE `char_id` = "+getcharid(0)+" LIMIT 1", .@prev_class; if (.@prev_class == gethominfo(1) ) { mes .@prev_class+" "+gethominfo(1); close; } else { mes .@prev_class; mes gethominfo(1); close; } } Now everytime I talk to that npc it shows something like: [Warning]: Unexpected type for argument 1. Expected string. [Debug]: Data: variable name='.@prev_class' index=0 [Debug]: Function: mes [Debug]: Source (NPC): SQLTest at prontera (154,182) [Warning]: Unexpected type for argument 1. Expected string. [Debug]: Data: number value=6009 [Debug]: Function: mes [Debug]: Source (NPC): SQLTest at prontera (154,182) Edited April 24, 2015 by utofaery
Aleos Posted April 24, 2015 Posted April 24, 2015 prontera,154,182,4 script SQLTest 90,{ query_sql "SELECT `prev_class` FROM `homunculus` WHERE `char_id` = "+getcharid(0), @prev_class; if (getarraysize(@prev_class)) { // If the person has a homunculus or not. if (@prev_class == gethominfo(1)) { mes "Your homunculus hasn't evolved yet!"; close; } else { mes "Previous class: "+@prev_class; mes "Current class: "+gethominfo(1); close; } } else { mes "You don't even have a homunculus!"; close; } 1
utofaery Posted April 25, 2015 Author Posted April 25, 2015 Sir your script is superb. And there is something stuff came up. Sometimes if homunculus is owned by profession other than alchemist, Sql data related to the homunculus is not deleted in table char and skill_homunculus, when delete or somehow. So I was hoping if there is way to clean not existing homunculus data in the db by script or not?
Aleos Posted April 25, 2015 Posted April 25, 2015 Are you talking about people using @makehomun? How would a class other than Alchemist get a homunculus?
utofaery Posted April 26, 2015 Author Posted April 26, 2015 Yes. Well the case would be npc script which grant player skill with call homunculus and rest resurrect homunculus. And rathena always make reset skill added by script command Eg. skill "bash",1; by npc script to archer Then after status change that skill is gone. And so I wish for an npc script to clean out leftover In table char, skill_homunculus, if linked homunculus non-exists anymore. Then @makehomun or by skill can create homunculus again.
Aleos Posted April 28, 2015 Posted April 28, 2015 Hm. Well you can always add a check before the query to get the class of the player, and if they aren't of Alchemist class, then ignore it.
Recommended Posts