Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

 

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 ...

Posted
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.

Posted (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 by utofaery
Posted

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;

}

  • Like 1
Posted

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?

Posted

Are you talking about people using @makehomun? How would a class other than Alchemist get a homunculus?

Posted

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.

Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...