AnnieRuru 957 Posted September 20, 2014 (edited) Download: 1.9plugin Create a market clone, to leave a message for other players while the player can go hunting/questing/events @market "<Title>" "<Message>" <Color> create a market clone with a chat room titled -> "<Title>" when players tries to join the chat room, it refuse the joining, but instead leave a message -> "<Message>" with 1.4 update, player can now choose their own favorite color for their AFK message the <Color> field is optional I was struggling to use array for the color list ... but in the end, I guess the simplicity is the best so you guys can guess how to add in your own list easily @marketkill kill the market clone without logging off when a GM do @killmonster @killmonster2, or *killmonster *kilmonsterall script command will not remove the clone but @reloadscript, however, will remove it feels like I just copy paste from the description whatever ... Credit : remember to rep Dastgir's topic because I mostly copy his codes 1.0plugin.patch 1.1plugin.patch -- fix clone's facing direction and sitting issue 1.2plugin.patch -- fix @killmonster still able to kill market clone 1.3plugin.patch-- change back all status-damage into status-kill for readability -- fix a bug that when a server enabled show_mob_info, the clone shouldn't has listed the hp nor level -- fix a bug that player shouldn't create a market clone while chatting or vending -- and for the patch, move all configuration into battle folder, makes more sense in this way (credit: Napster) -- add zeny requirement 1.4 - plugin - update to new plugin format - fix possible memory leak when a player input a fail message - change all i++ into ++i - no longer overwrite @reloadscript, hook to npc_reload function instead - since clif->messagecolor_self has been fixed, use that command in chat_joinchat_pre function - add configuration for player has a cart/mount/mado, the clone can display these items as well --- for me, it feels weird ... peco and cart is 1 thing, but warg and falcon ... ? - now player can choose to use their favorite color in their AFK message from a list - since all killmonster at/script functions looks the same, all of them hook to 1 same function 1.4a - optimized the OPTION area when spawn 1.5 - plugin - fix an issue that when using @hide, the market clone also clone as invisible ---- the real issue about this is, if that GM do @marketkill, the surrounding client will crash 1.6 - plugin - update to latest revision - remove all TBL_ and change to struct - add NULL checks to places where it needed - update the clif_charnameack with struct packet_reqnameall_ack 1.7 - plugin - fix memory leak for not removing the chatroom 1.8 - plugin - update to latest revision 1.9 - plugin - update to latest revision Edited October 27, 2020 by AnnieRuru 11 Only4fun, sever, nomade and 8 others reacted to this Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted September 20, 2014 thanks I'll add it to my server once Ind accept that pr Quote Share this post Link to post Share on other sites
THPO 7 Posted September 20, 2014 Calling Ind to merge it approve! Thank you for sharing your lovely work Annie Quote Share this post Link to post Share on other sites
vBrenth 39 Posted September 20, 2014 (edited) market.c: In function âatcommand_reloadscriptâ:market.c:273: warning: suggest parentheses around assignment used as truth valuemarket.c: In function âbattle_check_target_postâ:market.c:296: warning: suggest parentheses around assignment used as truth valuemarket.c: In function âchat_joinchat_preâ:market.c:312: warning: suggest parentheses around assignment used as truth valuemarket.c: In function âclif_getareachar_unit_postâ:market.c:335: warning: suggest parentheses around assignment used as truth valuemarket.c: In function âmap_quit_preâ:market.c:343: warning: suggest parentheses around assignment used as truth valuemarket.c: In function âstatus_percent_change_preâ:market.c:352: warning: suggest parentheses around assignment used as truth value Market works well. just that error should i remove the reloadscript on atcommand.c? And also why the clone is on size 1 mode, and it also dont copy the creators character position like how dastgir works. Edited September 20, 2014 by Wynne Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted September 20, 2014 (edited) Market works well. just that error should i remove the reloadscript on atcommand.c?I don't understand thisplugin should be able to overwrite the original atcommand . . And also why the clone is on size 1 modeMichieru recently revert back the SZ_SMALL and SZ_MEDIUM constanthttps://github.com/HerculesWS/Hercules/commit/8ab61745b81d1cf0602c7998f590aac8749187da so change the SZ_SMALL into SZ_MEDIUM I also don't really understand why though . . it also dont copy the creators character position like how dastgir works.it should spawn on character's coordinate ...where do your server spawn the clone then ? EDIT: Fixed your error on 1.0a Edited September 20, 2014 by AnnieRuru Quote Share this post Link to post Share on other sites
vBrenth 39 Posted September 20, 2014 it should spawn on character's coordinate ... where do your server spawn the clone then ? What im saying is the character position, for example you face is on the north is south the clone should copy it too and also if its your sitting while using @market the clone will copy ur character sitting too but the problem is you have to refresh/rewarp to see it sitting. (dastgir market) I don't understand thisplugin should be able to overwrite the original atcommand Its just throw me that error Michieru recently revert back the SZ_SMALL and SZ_MEDIUM constanthttps://github.com/H...590aac8749187da so change the SZ_SMALL into SZ_MEDIUM I also don't really understand why though Its fine its cute, just the character direction ehe. and compile warning o.O 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
GmOcean 92 Posted September 20, 2014 When creating this " clone ", is it possible to obtain it's GID? Because if so, you'd be able to command it like any normal mob right? I'm interested in this, because then I'd be able to attach the clones to a script and control them to fulfill my every whim.... Mainly I wanna use it in combination with my campfire system lol, eliminating my need for npc duplicates. Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted September 20, 2014 What im saying is the character position, for example you face is on the north is south the clone should copy it too and also if its your sitting while using @market the clone will copy ur character sitting too but the problem is you have to refresh/rewarp to see it sitting. (dastgir market) fixed in 1.1download again @GmOcean yes, read the mob_clone_spawn_market function have you forgotten about mob controller system ? Quote Share this post Link to post Share on other sites
GmOcean 92 Posted September 20, 2014 No, I didn't forget, just didn't know if these created mobs/clones would be able to function the same. Wasn't sure if there was a limitation put on them in the src which prevented it from being able to do whatever lol. But thanks for the info, gonna go run some tests now =p Quote Share this post Link to post Share on other sites
vBrenth 39 Posted September 21, 2014 I can't find any bug on 1.1 tested alot of things... even the warnings i gets is gone. Quote Share this post Link to post Share on other sites
Paroxysm 5 Posted September 21, 2014 Thank you so much AnnieRuru for the patch! you're the best. Quote Share this post Link to post Share on other sites
kyeme 71 Posted September 21, 2014 Thanks AnnieRuru! Quote Share this post Link to post Share on other sites
Angelmelody 221 Posted September 21, 2014 (edited) Hi~Annie,I'd like to report an issue: if you kill clone via @killmonster command(still working) ,and then log out your Character , map server will get crashed edit : I m using plugin v1.1 Edited September 21, 2014 by Angelmelody Quote Share this post Link to post Share on other sites
THPO 7 Posted September 21, 2014 @Annie just a question can it be allowed the same function like mapflag autotrade so it will only be usable on Towns. because Players might spam clones out of Town maps. Quote Share this post Link to post Share on other sites
GmOcean 92 Posted September 21, 2014 The patch already has those inside, + if ( !map->list[sd->bl.m].flag.town ) {+ clif->message( fd, "You can only use @market in a town.");+ return false;+ }+ if ( map->getcell( sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOCHAT ) ) {+ clif->message( fd, "You cannot use @market in this area.");+ return false;+ }+ if ( pc_isdead(sd) ) {+ clif->message( fd, "You can't create a Market clone while you are dead." );+ return false;+ }+ if ( npc->isnear( &sd->bl ) ) {+ clif->message( fd, "You can't create a Market clone too near to an npc." );+ return false;+ } Quote Share this post Link to post Share on other sites
astralprojection 35 Posted September 21, 2014 im getting this error in compiling:./configure --disable-renewal --enable-packetver=20140115using cygwinmake[1]: Entering directory '/home/tbl7/her/src/plugins' CC sample.c CC db2sql.c CC HPMHooking.c CC maintenance.c CC market_clone.cmarket_clone.c: In function ‘mob_clone_spawn_market’:market_clone.c:101:2: warning: implicit declaration of function ‘getFromMOBDATA’ [-Wimplicit-function-declaration] mmd = getFromMOBDATA(md,0); ^market_clone.c:101:6: warning: assignment makes pointer from integer without a cast [enabled by default] mmd = getFromMOBDATA(md,0); ^market_clone.c:105:2: warning: implicit declaration of function ‘addToMOBDATA’ [-Wimplicit-function-declaration] addToMOBDATA( md, mmd, 0, true ); ^market_clone.c: In function ‘battle_check_target_post’:market_clone.c:298:13: warning: assignment makes pointer from integer without a cast [enabled by default] if (( mmd = getFromMOBDATA( (TBL_MOB*)target, 0 ) )) ^market_clone.c: In function ‘chat_joinchat_pre’:market_clone.c:314:13: warning: assignment makes pointer from integer without a cast [enabled by default] if (( mmd = getFromMOBDATA(md,0) )) { ^market_clone.c: In function ‘clif_getareachar_unit_post’:market_clone.c:337:13: warning: assignment makes pointer from integer without a cast [enabled by default] if (( mmd = getFromMOBDATA( (TBL_MOB*)bl, 0) )) ^market_clone.c: In function ‘status_percent_change_pre’:market_clone.c:354:13: warning: assignment makes pointer from integer without a cast [enabled by default] if (( mmd = getFromMOBDATA( (TBL_MOB*)target, 0 ) )) { ^/tmp/ccVolWjl.o: In function `battle_check_target_post':/home/tbl7/her/src/plugins/market_clone.c:298: undefined reference to `getFromMOBDATA'/home/tbl7/her/src/plugins/market_clone.c:298:(.text+0x8d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `getFromMOBDATA'/tmp/ccVolWjl.o: In function `chat_joinchat_pre':/home/tbl7/her/src/plugins/market_clone.c:314: undefined reference to `getFromMOBDATA'/home/tbl7/her/src/plugins/market_clone.c:314:(.text+0x18a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `getFromMOBDATA'/tmp/ccVolWjl.o: In function `clif_getareachar_unit_post':/home/tbl7/her/src/plugins/market_clone.c:337: undefined reference to `getFromMOBDATA'/home/tbl7/her/src/plugins/market_clone.c:337:(.text+0x6d3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `getFromMOBDATA'/tmp/ccVolWjl.o: In function `status_percent_change_pre':/home/tbl7/her/src/plugins/market_clone.c:354: undefined reference to `getFromMOBDATA'/home/tbl7/her/src/plugins/market_clone.c:354:(.text+0x737): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `getFromMOBDATA'/tmp/ccVolWjl.o: In function `mob_clone_spawn_market':/home/tbl7/her/src/plugins/market_clone.c:101: undefined reference to `getFromMOBDATA'/home/tbl7/her/src/plugins/market_clone.c:101:(.text+0xa6d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `getFromMOBDATA'/home/tbl7/her/src/plugins/market_clone.c:105: undefined reference to `addToMOBDATA'/home/tbl7/her/src/plugins/market_clone.c:105:(.text+0xad2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `addToMOBDATA'collect2: error: ld returned 1 exit statusMakefile:82: recipe for target '../../plugins/market_clone.dll' failedmake[1]: *** [../../plugins/market_clone.dll] Error 1make[1]: Leaving directory '/home/tbl7/her/src/plugins'Makefile:116: recipe for target 'plugins' failedmake: *** [plugins] Error 2 Quote Share this post Link to post Share on other sites
GmOcean 92 Posted September 21, 2014 Right now, the plugin doesn't work. You'll have to use the patch until, Annieruru's suggestion for the plugin system gets added in. Quote Share this post Link to post Share on other sites
vBrenth 39 Posted September 21, 2014 Hi~Annie,I'd like to report an issue: if you kill clone via @killmonster command(still working) ,and then log out your Character , map server will get crashed edit : I m using plugin v1.1 Confirmed. Quote Share this post Link to post Share on other sites
Hadeszeus 15 Posted September 21, 2014 Hi~Annie,I'd like to report an issue: if you kill clone via @killmonster command(still working) ,and then log out your Character , map server will get crashed edit : I m using plugin v1.1 Confirming this. Thanks Annie! Quote Share this post Link to post Share on other sites
Darkpurple 1 Posted September 21, 2014 Hi~Annie,I'd like to report an issue: if you kill clone via @killmonster command(still working) ,and then log out your Character , map server will get crashed edit : I m using plugin v1.1 Confirming this. Thanks Annie! Confirmed too.. Quote Share this post Link to post Share on other sites
Angelmelody 221 Posted September 22, 2014 Hi~Annie,I'd like to report an issue: if you kill clone via @killmonster command(still working) ,and then log out your Character , map server will get crashed edit : I m using plugin v1.1 I try building a hooking function to prevent the market clone killed by @killmonster CMDint atkillmonster_sub_pre(struct block_list *bl, va_list *ap){ struct mob_data *md; struct monster_data *mmd; md = (struct mob_data *)bl; if ( ( mmd = getFromMOBDATA( md, 0 ) ) ) { if(mmd->market_chat_id){ hookStop(); return 0; } } return 1;}addHookPre( "atcommand->atkillmonster_sub", atkillmonster_sub_pre ); 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted September 23, 2014 thx Angelmelody up to version 1.2 @tlacson7 the plugin works but you have to patch this atm, I didn't properly code the removeFromMOBDB, removeFromMOBDATA, removeFromITEMDATA stuff (I never use them =/) so don't use these 3 commands yet Quote Share this post Link to post Share on other sites
kyeme 71 Posted September 23, 2014 @AnnieRuru,I have a suggestion, can you disable @market while vending, based on my knowledge in official you cannot create chatroom while vending.Thank you. 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
vBrenth 39 Posted September 23, 2014 @AnnieRuru, I have a suggestion, can you disable @market while vending, based on my knowledge in official you cannot create chatroom while vending. Thank you. Yeah when people vend, the clone must die Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted September 23, 2014 (edited) I just noticed somebody in rathena actually start converting my patch into rathena ... namely Napster well kinda a competition then, as rathena does have more user base than hercules version 1.3 released plugin or patch -- change back all status-damage into status-kill for readability -- fix a bug that when a server enabled show_mob_info, the clone shouldn't has listed the hp nor level (credit: Napster) -- fix a bug that player shouldn't create a market clone while chatting or vending -- and for the patch, move all configuration into battle folder, makes more sense in this way (credit: Napster) -- add zeny requirement Edited September 23, 2014 by AnnieRuru 2 karazu and kyeme reacted to this Quote Share this post Link to post Share on other sites