Jump to content

Skorm

Forum Moderator
  • Posts

    1282
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Skorm

  1. I believe query_sql is returning -1 if nothing was found. I'm not sure if this was changed in the default rAthena or just some other server I've encountered it before, but personally I think it's dumb. Anyways... if ( query_sql( "SELECT `name` FROM `char` WHERE `name` = '"+escape_sql(.@new$)+"'", .@name$ ) <= 0 ) {
  2. Sorry I didn't get back to you sooner but that command is pretty much a replica of addrid... Except for the BG ability I think. So kinda pointless. x_x
  3. - script leveling_control -1,{ OnNPCKillEvent: .@range = BaseLevel - getmonsterinfo( killedrid, MOB_LV ); .@range = .@range < 0 ? -.@range : .@range; if ( .@range < 10 ) { .@base = getmonsterinfo( killedrid, MOB_BASEEXP ); .@job = getmonsterinfo( killedrid, MOB_JOBEXP ); if ( .@base > 0 ) set BaseExp, BaseExp + .@base * 35 / 100; if ( .@job > 0 ) set JobExp , JobExp + .@job * 35 / 100; } end; }
  4. Yes...xD https://soundcloud.com/kore-wa-hentai/senpai-ver-hentai-dude-content-entry
  5. You can't use decimal in scripts... Instead you could do... BaseExp += ( BaseExp * 35 ) / 100; Which is roughly the same thing. Also for the record... BaseExp = BaseExp + BaseExp*0.35; And BaseExp = BaseExp * 1.35; Are the same. You could even shorten it to... BaseExp *= 1.35; In some languages.
  6. Try replacing ... if (src->type == BL_PC) { sprintf(str, "You've healed %s for %dhp!", tsd->status.name, hp); clif_displaymessage(sd->fd, str); } if (target->type == BL_PC && target->id != src->id) { sprintf(str, "You've been healed for %dhp by %s!", hp, sd->status.name); clif_displaymessage(tsd->fd, str); } With: if (src->type == BL_PC) { if (target->type == BL_PC) { sprintf(str, "You've healed %s for %dhp!", tsd->status.name, hp); clif_displaymessage(sd->fd, str); } else { sprintf(str, "Target healed for %dhp!", hp); clif_displaymessage(sd->fd, str); } } if (target->type == BL_PC && target->id != src->id) { sprintf(str, "You've been healed for %dhp by %s!", hp, sd->status.name); clif_displaymessage(tsd->fd, str); }
  7. I actually tested to see if that would happen... and it didn't on my server but try this... Replace: sprintf(str, "You've healed %d!", hp); clif_displaymessage (sd->fd, str); sprintf(str, "You've been healed %d!", hp); clif_displaymessage (tsd->fd, str); With: if (src->type == BL_PC) { sprintf(str, "You've healed %s for %dhp!", tsd->status.name, hp); clif_displaymessage(sd->fd, str); } if (target->type == BL_PC && target->id != src->id) { sprintf(str, "You've been healed for %dhp by %s!", hp, sd->status.name); clif_displaymessage(tsd->fd, str); } And change... char str[32]; To char str[255];
  8. This has already been done... Think I either updated another script or made my own I can't really remember but I know it's somewhere on the forums try searching for it.
  9. Why not just time how long it takes for the npc to travel one square... (.@distance * .@time_per_square_in_miliseconds); Well if the movement speed is like iRO it's 0.15s per-square at the normal walk speed. .@sleep = (.@distance * 150);
  10. There's probably a better way to do this but until someone does it... In skill.c after int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal) { int skill, hp = 0; struct map_session_data *sd = BL_CAST(BL_PC, src); struct map_session_data *tsd = BL_CAST(BL_PC, target); struct status_change *sc, *tsc; Add char str[255]; Then before return hp; } Add if (src->type == BL_PC) { if (target->type == BL_PC) { sprintf(str, "You've healed %s for %dhp!", tsd->status.name, hp); clif_displaymessage(sd->fd, str); } else { sprintf(str, "Target healed for %dhp!", hp); clif_displaymessage(sd->fd, str); } } if (target->type == BL_PC && target->id != src->id) { sprintf(str, "You've been healed for %dhp by %s!", hp, sd->status.name); clif_displaymessage(tsd->fd, str); }
  11. *viewpoint <action>,<x>,<y>,<point number>,<color>; This command will mark places on the mini map in the client connected to the invoking character. It uses the normal X and Y coordinates from the main map. The colors of the marks are defined using a hexadecimal number, same as the ones used to color text in 'mes' output, but are written as hexadecimal numbers in C. (They look like 0x<six numbers>.) Action is what you want to do with a point, 1 will set it, while 2 will clear it. 0 will also set it, but automatically removes the point after 15 seconds. Point number is the number of the point - you can have several. If more than one point is drawn at the same coordinates, they will cycle, which can be used to create flashing marks. // This command will show a mark at coordinates X 30 Y 40, is mark number 1, // and will be red. viewpoint 1,30,40,1,0xFF0000; This will create three points: viewpoint 1,30,40,1,0xFF0000; viewpoint 1,35,45,2,0xFF0000; viewpoint 1,40,50,3,0xFF0000; And this is how you remove them: viewpoint 2,30,40,1,0xFF0000; viewpoint 2,35,45,2,0xFF0000; viewpoint 2,40,50,3,0xFF0000; The client determines what it does with the points entirely, the server keeps no memory of where the points are set whatsoever. Is one way if a player is connected... But you're probably looking for... *questinfo <Quest ID>, <Icon> {, <Map Mark Color>{, <Job Class>}}; This is esentially a combination of checkquest and showevent. Use this only in an OnInit label. For the Quest ID, specify the quest ID that you want checked if it has been started yet. For Icon, use one of the following: No Icon : QTYPE_NONE ! Quest Icon : QTYPE_QUEST ? Quest Icon : QTYPE_QUEST2 ! Job Icon : QTYPE_JOB ? Job Icon : QTYPE_JOB2 ! Event Icon : QTYPE_EVENT ? Event Icon : QTYPE_EVENT2 Warg : QTYPE_WARG Warg Face : QTYPE_WARG2 (Only for packetver >= 20120410) Map Mark Color, when used, creates a mark in the user's mini map on the position of the NPC, the available color values are: 0 - No Marker 1 - Yellow Marker 2 - Green Marker 3 - Purple Marker When a user shows up on a map, each NPC is checked for questinfo that has been set. If questinfo is present, it will check if the quest has been started, if it has not, the bubble will appear. Optionally, you can also specify a Job Class if the quest bubble should only appear for a certain class. Example izlude,100,100,4 script Test 844,{ mes "[Test]"; mes "Hello World."; close; OnInit: questinfo 1001, QTYPE_QUEST, 0, Job_Novice; end; } I suggesting using some kind of search program to find the npc that use it.
  12. - script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); if( !compare( .tmp$, .@charmap$ ) ) end; set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_mac` = (SELECT `last_mac` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a); //set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",.@a ); //Annieruru Addition. if(.@len-1) { for( set( .@d, 0 ); .@d < .@len; set( .@d, .@d + 1 ) ) { getmapxy( .@map$, .@x, .@y, 0, rid2name(.@a[.@d]) ); if( .@charmap$ == .@map$ && rid2name(.@a[.@d]) != strcharinfo(0) ) { dispbottom "Duel accounts not allowed in WOE."; warp "geffen",0,0; } } } end; OnInit: setarray .maps$ , "aldeg_cas01", "gefg_cas01", "payg_cas01", "prtg_cas01"; set .lens , getarraysize(.maps$) ; for(set(.a,0);.a<.lens;set(.a,.a+1)) { setmapflag .maps$[.a], mf_loadevent ; set .tmp$ ,.tmp$+.maps$[.a]+","; } }
  13. This isn't a script thing might be source or general....
  14. That's because it isn't enclosed within the proper braces.
  15. This is more of a general question.
  16. Skorm

    Help me

    - script nevasca1 -1,{ OnPCLoginEvent: if ( player_login ){ skill 89,1,0; } else { player_login++; } } Could also count the logins from sql... But you can't call special tags from inside functions.
  17. Skorm

    NPC Deny Item?

    I would answer this but your dp scares the crap out of me.
  18. moc_para01,15,183,6 script Kafra Employee::kaf_pronteewqraee 117,{ cutin "kafra_01",2; callfunc "F_KafSet"; mes "[Kafra Employee]"; mes "Welcome to the"; mes "Kafra Corporation."; mes "The Kafra services"; mes "are always on your side."; mes "How may I assist you?"; callfunc "F_Kafra",5,0,0,40,800; //savepoint "moc_para01",30,186; getmapxy( .@map$, .@x, .@y, 0 ); savepoint .@map$, .@x, .@y; callfunc "F_KafEnd",0,1,"in the city of Prontera"; }
  19. If you're using the version by Masao... set $@Monster,1000+rand(1,323); Just increase the range. set .MonsterID,rand( 1001,2380 ); set $@Monster,1000+rand(1,995); The one by gmocean has a blacklist so i'd recommend that.
  20. Maybe this will help you out enough with your script. prontera,100,100,1 script chance_get 101,{ mes "[ Chancy ]"; mes "Oh hello would you like to try my game?"; next; if( select( "Yes:No" ) == 2 ) { mes "[ Chancy ]"; mes "I'm sorry to hear that. Maybe next time then."; close; } mes "[ Chancy ]"; if( countitem( .gold ) < .gold_amount ) { mes "You don't have enough "+getitemname( .gold )+"."; mes "I require at least "+.gold_amount+"."; close; } else if( Zeny < .zeny ) { mes "It looks like you don't have enough zeny..."; mes "You need at least "+.zeny+"."; close; } Zeny = Zeny - .zeny; delitem .gold, .gold_amount; if( rand( 101 ) <= .chance ) { .@rand = rand( .length ); getitem .rewards[.@rand], .reward_amounts[.@rand]; mes "Congratulations you got "+getitemname( .rewards[.@rand] )+" x"+.reward_amounts[.@rand]+"!!!"; } else mes "I'm sorry you didn't get anything. Come back and try again!"; close; OnInit: .gold = 617; .gold_amount = 100; .zeny = 10000000; .chance = 40; setarray .rewards, 501, 502, 503, 504, 506; setarray .reward_amounts, 1, 1, 1, 2, 2; .length = getarraysize( .rewards ); }
  21. I've tested it and it is working... I recommend using rAthena if you aren't already.
  22. Just remove set from that line.
  23. amatsu,235,237,4 script healer 925,{ end; OnInit: freeloop(1); getmapxy( .m$, .x, .y, 1, strnpcinfo(0) ); OnTimer5000: initnpctimer; addrid( 4, 0, .x-15, .y-15, .x+15, .y+15 ); if( playerattached() ) { getinventorylist; .@len = @inventorylist_count; copyarray .@inventorylist_id, @inventorylist_id, .@len; copyarray .@inventorylist_identify, @inventorylist_identify, .@len; for ( .@j = 0; .@j < .@len; .@j++ ) { if ( !.@inventorylist_identify[.@j] ) { delitem2 .@inventorylist_id[.@j], 1, 0, 0, 0, 0, 0, 0, 0; getitem .@inventorylist_id[.@j], 1; } } if( HP < MAXHP ) { specialeffect2 EF_HEAL2; percentheal 100, 100; } repairall; } }
  24. Copy the Raw Data from the bottom of pastebin it preserves tabs.
  25. Skorm

    ###### Spawn

    - script NPCNAME -1,{ OnInit: OnHour00: if( !mobcount("prt_fild01","NPCNAME::OnMonsterExist") ) monster "prt_fild01",0,0,"--ja--",1001,1,"NPCNAME::OnMonsterExist"; OnMonsterExist: }
×
×
  • Create New...