Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by Capuche

  1. Monster command already return the gid in $@mobid array mapreg_setreg(reference_uid(add_str("$@mobid"), i), mobid);
  2. I really like the bank and the mini map system
  3. Try prontera,1,1,0 script #event_race 45,{ end; OnKillLeader: killmonster .event_map$,strnpcinfo(3) +"::OnKillMob"; if ( .nodrop ) { removemapflag .event_map$, mf_nomobloot; removemapflag .event_map$, mf_nomvploot; } // Setting setarray .@reward[0], 501,10, // reward id, amount 502,5, 503,2; // end setting announce "Player "+ strcharinfo(0) +" killed the Monster Leader!",0; .@r = rand( getarraysize(.@reward) /2 ) *2;// random reward dispbottom "You get "+ .@reward[.@r+1] +" "+ getitemname(.@reward[.@r]) +"."; getitem .@reward[.@r], .@reward[.@r+1]; end; OnKillMob: Zeny = Zeny + 1000; dispbottom "You get 1000 Zeny.";// zeny to kill minion end; OnInit: OnHour00: // Setting .@mode = 0; // no boss 0 - allow boss 1 .nodrop = 1; // no mob drop 1 else 0 .@total = 50; // number mob (max 128) setarray .@town$[0],"prontera"; setarray .@race$[0], RC_Formless,"Formless",// comments line to disable RC_Undead,"Undead", RC_Brute,"Animal", RC_Plant,"Plant", RC_Insect,"Insect", RC_Fish,"Fish", RC_Demon,"Demon", RC_DemiHuman,"Demihuman", RC_Angel,"Angel", RC_Dragon,"Dragon"; // end setting .@t = rand( getarraysize( .@town$ ) ); .@r = rand( getarraysize(.@race$)/2 ) *2; .event_map$ = .@town$[.@t]; do { .@x = rand(1,300); .@y = rand(1,300); } while( !checkcell(.event_map$,.@x,.@y,cell_chkpass) ); .@x1 = .@x - 5; .@x2 = .@x + 5; .@y1 = .@y - 5; .@y2 = .@y + 5; .pc_maxlvl = 0; // event // warpchar .event_map$,.@x,.@y,5;// debug donpcevent strnpcinfo(3) +"::OnLevel"; if ( .pc_maxlvl == 0 ) end;// no player on the map sleep 50; unitwarp getnpcid(0),.event_map$,.@x,.@y; hideoffnpc strnpcinfo(3); if ( .nodrop ) { setmapflag .event_map$, mf_nomobloot; setmapflag .event_map$, mf_nomvploot; } announce "The event will start in "+ .@town$[.@t] +" against race "+ .@race$[.@r+1] +"!",0; sleep 5000; if ( .@mode == 0 ) .@mvp$ = "MEXP = 0 and ~Mode&0x000020 and "; query_sql( "select ID,LV from mob_db_re "+ "where kName not like 'Treasure%' and "+ .@mvp$ +"LV <= "+ .pc_maxlvl +" and Race = "+ .@race$[.@r] +" and Mode&0x000080 and "+ "( `Drop1id` > 0 or `Drop2id` > 0 or `Drop3id` > 0 or `Drop4id` > 0 or `Drop5id` > 0 or `Drop6id` > 0 or `Drop7id` > 0 or `Drop8id` > 0 or "+ "`Drop9id` > 0 or DropCardid > 0 ) order by rand() limit "+ .@total, .@mob_id, .@lvl ); .@size = getarraysize( .@mob_id ); for ( .@i = 0; .@i < .@size; .@i++ ) {// return index mob max lvl if ( .@mob_maxlvl < .@lvl[.@i] ) { .@mob_maxlvl = .@lvl[.@i]; .@index = .@i; } } for ( .@i = 0; .@i < .@size; .@i++ ) { if ( .@i == .@index ) areamonster .event_map$,.@x1,.@y1,.@x2,.@y2,"Leader",.@mob_id[.@i],1,strnpcinfo(3) +"::OnKillLeader"; else areamonster .event_map$,.@x1,.@y1,.@x2,.@y2,"--ja--",.@mob_id[.@i],1,strnpcinfo(3) +"::OnKillMob"; } announce "Monster "+ getmonsterinfo( .@mob_id[.@index],MOB_NAME ) +" is the leader !",0; hideonnpc strnpcinfo(3); end; OnLevel: addrid 0; if ( strcharinfo(3) != .event_map$ || .pc_maxlvl >= BaseLevel ) end; .pc_maxlvl = BaseLevel; end; }
  4. There is an extra param in your getitem2 (about the account, acc id 0), try getitem2 2306,1,1,5,0,4003,0,0,0;
  5. I don't see anything wrong related with your error, please show the part before set(.player,getcharid(3)); However some mistakes if (.player == $mapabombporing$ ) { .player return the account id of the player attached while $mapabombporing$ return a string, the map getitem(512,1,set(.@a,.players[rand(getarraysize(.players))])); Your script give actually one item to 1 random player in your server (not only on the map, see addrid doc)
  6. - shop Custons Grátis 714,1750:1,1770:2,1751:3,1752:3; prontera,146,192,3 script Custons Grátis 714,{ callshop "Custons",1; end; OnInit: waitingroom "Custons Grátis!",0,"",0; }
  7. case UNT_THORNS_TRAP: is a part of a big switch( ) just put before the switch struct mob_data *md = BL_CAST(BL_MOB, bl);
  8. Try struct mob_data *md = BL_CAST(BL_MOB, bl); if (md && md->mob_id == <mobid>)// replace by your mobid break; if you get a warning on md, insert the struct before the switch
  9. prontera,150,175,0 script testparty 521,{ npctalk "You're required to enter the waitingroom."; end; OnInit: waitingroom "test",11,"testparty::OnFull",10; end; OnFull: getmapxy .@map$, .@x, .@y,1; warpwaitingpc .@map$,.@x,.@y; for ( .@i = 0; .@i < $@warpwaitingpcnum; .@i++ ) { .@name$ = rid2name($@warpwaitingpc[.@i]); .@char_id = getcharid( 0,.@name$ ); if ( getcharid( 1,.@name$ ) > 0 ) party_delmember( .@char_id ); sleep 50; if ( .@create == 0 ) { while( party_create( "party"+ rand(10000), 1 ) == -3 ); .@create = 1; } else if ( $@party_create_id ) { party_addmember $@party_create_id,.@char_id; // npctalk "An error occur."; end; } } end; OnPCStatCalcEvent: OnPCLogoutEvent: if ( strcharinfo(3) != "alberta" || getcharid(1) == 0 ) end; .@party_id = getcharid(1); if ( getcharid(0) != getpartyleader( .@party_id,2) ) party_delmember(); else { if ( instance_check_party(.@party_id,2) == 0 ) party_destroy(.@party_id); else { getpartymember .@party_id,1; getpartymember .@party_id,2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i],$@partymembercid[.@i] ) && $@partymembercid[.@i] != getcharid(0) ) { party_changeleader .@party_id,$@partymembercid[.@i]; party_delmember $@partymembercid[.@i],.@party_id; break; } } } } end; } just need a sleep in the script
  10. Try prontera,150,175,0 script testparty 521,{ npctalk "You're required to enter the waitingroom."; end; OnInit: waitingroom "test",11,"testparty::OnFull",0; end; OnFull: getmapxy .@map$, .@x, .@y,1; warpwaitingpc .@map$,.@x,.@y; for ( .@i = 0; .@i < $@warpwaitingpcnum; .@i++ ) { .@name$ = rid2name($@warpwaitingpc[.@i]); .@char_id = getcharid( 0,.@name$ ); if ( getcharid( 1,.@name$ ) > 0 ) party_delmember( .@char_id ); if ( .@create == 0 ) { while( party_create( "party_"+ rand(10000), .@char_id ) == -3 ); .@create = 1; } else if ( $@party_create_id && party_addmember( $@party_create_id,.@char_id ) < 1 ) { npctalk "An error occur."; end; } } end; OnPCStatCalcEvent: OnPCLogoutEvent: if ( strcharinfo(3) != "alberta" || getcharid(1) == 0 ) end; .@party_id = getcharid(1); if ( getcharid(0) != getpartyleader( .@party_id,2) ) party_delmember(); else { if ( instance_check_party(.@party_id,2) == 0 ) party_destroy(.@party_id); else { getpartymember .@party_id,1; getpartymember .@party_id,2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i],$@partymembercid[.@i] ) && $@partymembercid[.@i] != getcharid(0) ) { party_changeleader .@party_id,$@partymembercid[.@i]; party_delmember $@partymembercid[.@i],.@party_id; break; } } } } end; }
  11. I don't understand the issue
  12. Reply for blind man Set guild_skill_relog_delay to 0 guild_skill_relog_delay: 0
  13. add a end at the end of each label OnHour13: AgitStart; announce "The War Of Emperium has begun!( Pay_gld 140 160 )",bc_all; end; OnHour14: AgitEnd; announce "The War Of Emperium has Over!",bc_all; end; /// ...
  14. Wait why did I use a function?! //5x5 area around the npc prtg_cas04,160,150,1 script gmwarpouttreasure -1,6,6,{ OnTouch: if (getgmlevel() <= 1 && getguildmasterid( getcastledata( strcharinfo(3),1 ) ) != getcharid(0)) mes "You are not a Guild Master of this Castle"; else if (getgmlevel() > 1 && getgmlevel() <= 98) mes "GAME MASTER, you are not allowed here."; else end; close2; warp "SavePoint",0,0; end; } prtg_cas05,281,176,1 duplicate(gmwarpouttreasure) gmwarpouttreasure2 -1,6,6 // others duplicate for other castle
  15. well then 3ceam doesn't support strnpcinfo(4) 4 - The name of the map the NPC is in. try //5x5 area around the npc prtg_cas04,160,150,1 script gmwarpouttreasure -1,5,5,{ OnTouch: callfunc "F_gmwarpouttreasure", "prtg_cas04"; } function script F_gmwarpouttreasure { if (getgmlevel() <= 1 && getguildmasterid( getcastledata( getarg(0),1 ) ) != getcharid(0)) mes "You are not a Guild Master of this Castle"; else if (getgmlevel() > 1 && getgmlevel() <= 98) mes "GAME MASTER, you are not allowed here."; else end; close2; warp "SavePoint",0,0; end; } just need to call the fuction for the other castle
  16. That's weird I just tested it and it's working, i can't reproduce your problem. Btw your coordinates for the treasure room is wrong, ref. https://github.com/rathena/rathena/blob/master/npc/guild/agit_main.txt#L594 (if you take this coordinate, put a bigger x/y trigger) do you use rathena?
  17. My bad try //5x5 area around the npc prtg_cas04,160,150,1 script gmwarpouttreasure -1,5,5,{ OnTouch: if (getgmlevel() <= 1 && getguildmasterid( getcastledata( strnpcinfo(4),1 ) ) != getcharid(0)) mes "You are not a Guild Master of this Castle"; else if (getgmlevel() > 1 && getgmlevel() <= 98) mes "GAME MASTER, you are not allowed here."; else end; close2; warp "SavePoint",0,0; end; }
  18. I don't understand. Skotlex was a core dev..
  19. It does and it will run your loop every duplicate, only OnInit: getmapxy .@map$, .@x, .@y, 1; unitwarp 0, .@map$, -1, -1; end; is needed
  20. From what I know there is no such mode for mob, only MD_TARGETWEAK but you can add a new mode diff --git a/src/map/mob.c b/src/map/mob.c index 0e2b177..848b9ce 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1071,6 +1071,9 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) if ((mode&MD_TARGETWEAK) && status_get_lv(bl) >= md->level-5) return 0; + if ((mode&MD_TARGETSTRONG) && status_get_lv(bl) <= md->level) + return 0; + if(battle_check_target(&md->bl,bl,BCT_ENEMY)<=0) return 0; diff --git a/src/map/status.h b/src/map/status.h index 251e5ad..dd03334 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1562,6 +1562,7 @@ enum e_mode { MD_MVP = 0x080000, MD_IGNOREMISC = 0x100000, MD_KNOCKBACK_IMMUNE = 0x200000, + MD_TARGETSTRONG = 0x400000, }; #define MD_MASK 0x00FFFF #define ATR_MASK 0xFF0000 MD_TARGETSTRONG mode : monster lvl >= player lvl --> monster passive refer to mode in mob_db.txt // ID,Sprite_Name,kROName,iROName,LV,HP,SP,EXP,JEXP,Range1,ATK1,ATK2,DEF,MDEF,STR,AGI,VIT,INT,DEX,LUK,Range2,Range3,Scale,Race,Element,Mode,Speed,aDelay,aMotion,dMotion,MEXP,MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per,Drop1id,Drop1per,Drop2id,Drop2per,Drop3id,Drop3per,Drop4id,Drop4per,Drop5id,Drop5per,Drop6id,Drop6per,Drop7id,Drop7per,Drop8id,Drop8per,Drop9id,Drop9per,DropCardid,DropCardper and the docs https://github.com/rathena/rathena/blob/master/doc/mob_db.txt
  21. I just figured out yes... //5x5 area around the npc prtg_cas04,160,150,1 script gmwarpouttreasure -1,5,5,{ OnTouch: if (getgmlevel() <= 1 && getguildmasterid( getcastledata( strnpcinfo(4),1 ) ) != getcharid(0)) mes "You are not a Guild Master of this Castle"; else if (getgmlevel() <= 98) mes "GAME MASTER, you are not allowed here."; else end; close2; warp "SavePoint",0,0; end; }
  22. Every duplicate will run OnInit. Well I need a sample of your work..
  23. The NPC use the same diag for prere and re version to start the super nono ex quest. https://github.com/rathena/rathena/blob/master/npc/jobs/novice/supernovice.txt I forgot to specify sorry, replace in this file what I said above
  24. Try //5x5 area around the npc prtg_cas04,160,150,1 script gmwarpouttreasure -1,5,5,{ OnTouch: if (getgmlevel() <= 98) { if (getgmlevel() <= 1 && getguildmasterid( getcastledata( strnpcinfo(4),1 ) ) != getcharid(0)) mes "You are not a Guild Master of this Castle"; else if (getgmlevel() <= 98) mes "GAME MASTER, you are not allowed here."; close2; warp "SavePoint",0,0; } end; }
×
×
  • Create New...