PewN Posted February 13, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Share Posted February 13, 2013 (edited) i try to modify some of factionmonster script of lilith i want to be a variable like thishttp://rathena.org/b...st/#entry153174 md = mob_once_spawn_sub(&sd->bl, m, x, y, str, class_, event); if (md) { md->faction_id = faction; // this line md->special_state.ai = 1; mob_spawn(md); clif_specialeffect(&md->bl,344,AREA); sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000); } i want to change the line to this scriptmd->pc_readglobalreg( sd, "pvpteam" ) = faction bump? please help bump bump! Edited February 13, 2013 by TrojanWorm Quote Link to comment Share on other sites More sharing options...
clydelion Posted February 14, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted February 14, 2013 From what I've understood on your post, it should be this way md->faction_id = pc_readglobalreg( sd, "pvpteam" ); Quote Link to comment Share on other sites More sharing options...
PewN Posted February 14, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 14, 2013 (edited) here's the whole source /** * Faction System [Lilith] * factionmonster("<map name>",<x>,<y>,"<name to show>",<mob ID>,<amount>,<faction ID>{,"<event label>"}); **/ BUILDIN_FUNC(factionmonster) { const char* mapn = script_getstr(st,2); int x = script_getnum(st,3); int y = script_getnum(st,4); const char* str = script_getstr(st,5); int class_ = script_getnum(st,6); int amount = script_getnum(st,7); int faction = script_getnum(st,8); const char* event = ""; struct map_session_data* sd; struct mob_data *md; int m; if( script_hasdata(st,9) ) { event = script_getstr(st,9); check_event(st, event); } if( class_ >= 0 && !mobdb_checkid(class_) ) { ShowWarning("buildin_factionmonster: Attempted to spawn non-existing monster class %d\n", class_); return 1; } sd = map_id2sd(st->rid); if( sd && strcmp(mapn,"this") == 0 ) m = sd->bl.m; else { m = map_mapname2mapid(mapn); if( map[m].flag.src4instance && st->instance_id ) { if( (m = instance_mapid2imapid(m, st->instance_id)) < 0 ) { ShowError("buildin_factionmonster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn); return 1; } } } md = mob_once_spawn_sub(&sd->bl, m, x, y, str, class_, event); if (md) { pc_readglobalreg( sd, "pvpteam" ) = faction; md->special_state.ai = 1; mob_spawn(md); clif_specialeffect(&md->bl,344,AREA); sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000); } script_pushint(st,md->bl.id); return 0; } cuz the source have the int faction Edited February 14, 2013 by TrojanWorm Quote Link to comment Share on other sites More sharing options...
clydelion Posted February 14, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted February 14, 2013 Yes, do what I said above. http://upaste.me/raw/b741537463091140 1 Quote Link to comment Share on other sites More sharing options...
PewN Posted February 15, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 15, 2013 Yes, do what I said above. http://upaste.me/raw/b741537463091140 hmm.. im a little bit confused how can i set the faction of the monster? From what I've understood on your post, it should be this way md->faction_id = pc_readglobalreg( sd, "pvpteam" ); sir clydelion how can i set the faction of the monster? Quote Link to comment Share on other sites More sharing options...
Lilith Posted February 15, 2013 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted February 15, 2013 No need to modify this code. See doc: * factionmonster("<map name>",<x>,<y>,"<name to show>",<mob ID>,<amount>,<faction ID>{,"<event label>"}); Example: (if player attached) factionmonster("prontera",155,180,"Example",1002,1,pvpteam); Quote Link to comment Share on other sites More sharing options...
PewN Posted February 16, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 16, 2013 No need to modify this code. See doc: * factionmonster("<map name>",<x>,<y>,"<name to show>",<mob ID>,<amount>,<faction ID>{,"<event label>"}); Example: (if player attached) factionmonster("prontera",155,180,"Example",1002,1,pvpteam); thx i will try this lilith thx @Clydelion thanks for helping me sir... @lilith how if i set in on script cuz i want to make a faction war like dota race to destroy the Throne Quote Link to comment Share on other sites More sharing options...
Lilith Posted February 16, 2013 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted February 16, 2013 You can still use 'factionmonster' with event label, but monster would be MD_PLANT(0x40) mode, for example, so this monster cant walk. factionmonster("prt_fild08",0,0,"Red Team",2135,1,pvpteam,"NPC::OnLabel"); OnLabel: <,,,> Quote Link to comment Share on other sites More sharing options...
PewN Posted February 16, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 16, 2013 (edited) You can still use 'factionmonster' with event label, but monster would be MD_PLANT(0x40) mode, for example, so this monster cant walk. factionmonster("prt_fild08",0,0,"Red Team",2135,1,pvpteam,"NPC::OnLabel"); OnLabel: <,,,> hmm im getting error on the factionmonster source the pvpteam how can i do like this? o set your script set pvpteam, 1; // they assign to team no.1 set pvpteam, 2; // they assign to team no.2 here's the modified source of your faction monster how can i set the faction_id as pvpteam(globalreg) if the monster[pvpteam,1] will attack the other monster[pvpteam,2 ...] and the monster[pvpteam,1] will not attack the same variable.. please help BUILDIN_FUNC(factionmonster) { const char* mapn = script_getstr(st,2); int x = script_getnum(st,3); int y = script_getnum(st,4); const char* str = script_getstr(st,5); int class_ = script_getnum(st,6); int amount = script_getnum(st,7); int faction = script_getnum(st,8); const char* event = ""; unsigned int size = SZ_SMALL; unsigned int ai = AI_NONE; struct map_session_data* sd; struct mob_data *md; int m; if( script_hasdata(st,9) ) { event = script_getstr(st,9); check_event(st, event); } if (class_ >= 0 && !mobdb_checkid(class_)) { ShowWarning("buildin_factionmonster: Attempted to spawn non-existing monster class %d\n", class_); return 1; } sd = map_id2sd(st->rid); if( sd && strcmp(mapn,"this") == 0 ) m = sd->bl.m; else { m = map_mapname2mapid(mapn); if( map[m].flag.src4instance && st->instance_id ) { if( (m = instance_mapid2imapid(m, st->instance_id)) < 0 ) { ShowError("buildin_factionmonster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn); return 1; } } } md = mob_once_spawn_sub(&sd->bl, m, x, y, str, class_, event, size, ai); if (md) { md->faction_id = faction; md->special_state.ai=1; mob_spawn (md); clif_specialeffect(&md->bl,344,AREA); sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000); } script_pushint(st,md->bl.id); return 0; } is this correct? Edited February 16, 2013 by TrojanWorm Quote Link to comment Share on other sites More sharing options...
WhiteEagle Posted February 18, 2013 Group: Members Topic Count: 79 Topics Per Day: 0.02 Content Count: 480 Reputation: 67 Joined: 08/28/12 Last Seen: 17 hours ago Share Posted February 18, 2013 Other question, can anyone help me with this error?script.c: In function âbuildin_factionmonsterâ:script.c:17680: error: too few arguments to function âmob_once_spawn_subâ This is a part from: md = mob_once_spawn_sub(&sd->bl, m, x, y, str, class_, event); if (md){md->faction_id = pc_readglobalreg( sd, "pvpteam" );md->special_state.ai = 1;mob_spawn(md);clif_specialeffect(&md->bl,344,AREA);sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);}script_pushint(st,md->bl.id);return 0;} I tried some changes to fixed it, but I got everytime the same error. It would be very nice, when anyone know a solution. Has nobody a solution? Quote Link to comment Share on other sites More sharing options...
PewN Posted February 18, 2013 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted February 18, 2013 Thank's for help. Topic Solved!.. Quote Link to comment Share on other sites More sharing options...
WhiteEagle Posted February 18, 2013 Group: Members Topic Count: 79 Topics Per Day: 0.02 Content Count: 480 Reputation: 67 Joined: 08/28/12 Last Seen: 17 hours ago Share Posted February 18, 2013 bumb Quote Link to comment Share on other sites More sharing options...
Question
PewN
i try to modify some of factionmonster script of lilith i want to be a variable like this
http://rathena.org/b...st/#entry153174
i want to change the line to this script
bump? please help
bump bump!
Edited by TrojanWormLink to comment
Share on other sites
11 answers 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.