script command modification need help

Angelmelody

(\ /) ( . .)
Messages
772
Points
0
Age
32
Location
new_1-1,53,111
Github
Angelmelody
Emulator
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
default_wink.png


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

Code:
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;}
Code:
 BUILDIN_DEF(warpportal2,"viisi?"),
 
Doesn't Work, Removed.

 
Last edited by a moderator:
Back
Top