Jump to content
  • 0
Angelmelody

script command modification need help

Question

I want the location of  warpportal  can be specified and  then refer  to original warpportal command 

 

 to create new command warpportal2 , but it was still not working  as  my  Intended

 

 I have no idea why It does't  work , I m still noob in src

 

 please check my code ,  thank you ;)

 

 

 

 

warpportal2 {"<source map>"},<source x>,<source y>,"<target map>",<target x>,<target y>;

 

 

BUILDIN(warpportal2) {    int spx;    int spy;    unsigned short smapindex, tmapindex;    int tpx;    int tpy;    struct skill_unit_group* group;    struct block_list* bl;        bl = map->id2bl(st->oid);    if( bl == NULL )    {        ShowError("script:warpportal: npc is neededn");        return false;    }    if( script_hasdata(st, 7) ){        smapindex = mapindex_name2id(script_getstr(st,2));        if( smapindex == 0 )            return true;// map not found        spx = script_getnum(st,3);        spy = script_getnum(st,4);        tmapindex = mapindex_name2id(script_getstr(st, 5));        tpx = script_getnum(st,6);        tpy = script_getnum(st,7);        } else {        spx = script_getnum(st,2);        spy = script_getnum(st,3);        tmapindex = mapindex_name2id(script_getstr(st, 4));        tpx = script_getnum(st,5);        tpy = script_getnum(st,6);        }    if( tmapindex == 0 )        return true;// map not found        group = skill->unitsetting(bl, AL_WARP, 4, spx, spy, 0);    if( group == NULL )        return true;// failed    if(smapindex != 0)        group->map = smapindex;    group->val1 = (group->val1<<16)|(short)0;    group->val2 = (tpx<<16) | tpy;    group->val3 = tmapindex;        return true;}

 

 BUILDIN_DEF(warpportal2,"viisi?"),

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.