Jump to content

dfabsgwapings

Members
  • Content Count

    165
  • Joined

  • Last visited


Reputation Activity

  1. Upvote
    dfabsgwapings reacted to Legend in equipment restriction   
    I can confirm this too...
    Equippable items can't be restricted even with map_zone_db, well i thought t'was working properly.
     
    So I made an alternative script
    Link: http://upaste.me/b63938928ba159ff3
    Please do report if you found bugs regarding to that script.

     
    Edit: Oops, found a bug.
    Script updated with the same link! 
  2. Upvote
    dfabsgwapings reacted to Dastgir in Card announce   
    atleast a little edit might be required, just to get itemID into script from getrandgroupitem.
    In that case:
    Script.c:
    /* getrandgroupitem <container_item_id>,<quantity> */ BUILDIN(getrandgroupitem) { struct item_data *data = NULL; struct map_session_data *sd = NULL; int nameid = script_getnum(st, 2); int count = script_getnum(st, 3); if( !(data = itemdb->exists(nameid)) ) { ShowWarning("buildin_getrandgroupitem: unknown item id %d\n",nameid); script_pushint(st, 1); } else if ( count <= 0 ) { ShowError("buildin_getrandgroupitem: qty is <= 0!\n"); script_pushint(st, 1); } else if ( !data->group ) { ShowWarning("buildin_getrandgroupitem: item '%s' (%d) isn't a group!\n",data->name,nameid); script_pushint(st, 1); } else if( !( sd = script->rid2sd(st) ) ) { ShowWarning("buildin_getrandgroupitem: no player attached!! (item %s (%d))\n",data->name,nameid); script_pushint(st, 1); } else { int i, get_count, flag; struct item it; memset(&it,0,sizeof(it)); nameid = itemdb->group_item(data->group); it.nameid = nameid; it.identify = itemdb->isidentified(nameid); if (!itemdb->isstackable(nameid)) get_count = 1; else get_count = count; for (i = 0; i < count; i += get_count) { // if not pet egg if (!pet->create_egg(sd, nameid)) { if ((flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT))) { clif->additem(sd, 0, 0, flag); if( pc->candrop(sd,&it) ) map->addflooritem(&sd->bl, &it, get_count, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0); } } } script_pushint(st, 0); } return true; } To
    /* getrandgroupitem <container_item_id>,<quantity> */ BUILDIN(getrandgroupitem) { struct item_data *data = NULL; struct map_session_data *sd = NULL; int nameid = script_getnum(st, 2); int count = script_getnum(st, 3); if( !(data = itemdb->exists(nameid)) ) { ShowWarning("buildin_getrandgroupitem: unknown item id %d\n",nameid); script_pushint(st, 1); } else if ( count <= 0 ) { ShowError("buildin_getrandgroupitem: qty is <= 0!\n"); script_pushint(st, 1); } else if ( !data->group ) { ShowWarning("buildin_getrandgroupitem: item '%s' (%d) isn't a group!\n",data->name,nameid); script_pushint(st, 1); } else if( !( sd = script->rid2sd(st) ) ) { ShowWarning("buildin_getrandgroupitem: no player attached!! (item %s (%d))\n",data->name,nameid); script_pushint(st, 1); } else { int i, get_count, flag; struct item it; memset(&it,0,sizeof(it)); nameid = itemdb->group_item(data->group); it.nameid = nameid; it.identify = itemdb->isidentified(nameid); if (!itemdb->isstackable(nameid)) get_count = 1; else get_count = count; for (i = 0; i < count; i += get_count) { // if not pet egg if (!pet->create_egg(sd, nameid)) { if ((flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT))) { clif->additem(sd, 0, 0, flag); if( pc->candrop(sd,&it) ) map->addflooritem(&sd->bl, &it, get_count, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0); } } } script_pushint(st, nameid); } return true; } * just script_pushint(st, 0) is changed above *
     
     
    Then you can do from script side as follows in item_db script section:
    .@item = getrandgroupitem(12246, 1); if (.@item > 1) { announce strcharinfo(PC_NAME) +" Got "+ getitemname(.@item) +" From MVA", bc_all; }
  3. Upvote
    dfabsgwapings reacted to Garr in Chat/PM issue   
    Go into friend window options, and uncheck opening 1:1 chats.
  4. Upvote
    dfabsgwapings reacted to Asheraf in Kafrapoints   
    @dfabsgwapings
    try to use this one
     
    prontera,137,223,5 script Test 4_F_KAFRA3,{ mes "[Test]"; mes "Please purchase only 1 item at a time to avoid loss of points."; next; mes "[Test]"; mes "Please select a category."; switch(select("Items:Pet Eggs:Headgears")){ case 1: openshop("vote01"); end; case 2: openshop("vote02"); end; case 3: openshop("vote03"); end; } } - trader vote01 1_M_01,{ OnInit: tradertype(NST_CUSTOM); sellitem Red_Potion,2; end; OnCountFunds: setcurrency(#KAFRAPOINTS); end; OnPayFunds: if( #KAFRAPOINTS < @points ) end; #KAFRAPOINTS -= @points; purchaseok(); end; } - trader vote02 1_M_01,{ OnInit: tradertype(NST_CUSTOM); sellitem Red_Potion,2; end; OnCountFunds: setcurrency(#KAFRAPOINTS); end; OnPayFunds: if( #KAFRAPOINTS < @points ) end; #KAFRAPOINTS -= @points; purchaseok(); end; } - trader vote03 1_M_01,{ OnInit: tradertype(NST_CUSTOM); sellitem Red_Potion,2; end; OnCountFunds: setcurrency(#KAFRAPOINTS); end; OnPayFunds: if( #KAFRAPOINTS < @points ) end; #KAFRAPOINTS -= @points; purchaseok(); end; }
×
×
  • Create New...

Important Information

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