@market clone

AnnieRuru

~~Cute~Cute~Scripter~~
Messages
1,677
Points
0
Location
your next door ~
Discord
AnnieRuru#1609
Github
AnnieRuru
Emulator
Client Version
2019-05-30aRagexeRE
Download: 1.9
plugin

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
default_dry.png

whatever ...

Credit : remember to rep
rep_up.png
Dastgir's topic because I mostly copy his codes

1.0
plugin.
patch

1.1
plugin.
patch
-- fix clone's facing direction and sitting issue

1.2
plugin.
patch
-- fix @killmonster still able to kill market clone

1.3
plugin.
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

 
Last edited by a moderator:
thanks
default_biggrin.png
I'll add it to my server once Ind accept that pr
default_biggrin.png


 
Calling Ind to merge it
default_biggrin.png
approve! Thank you for sharing your lovely work Annie 
default_wub.png


 
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.

 
Last edited by a moderator:
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 mode
Michieru 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

 
Last edited by a moderator:
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
default_biggrin.png


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

 
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.

 
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 ?

 
Last edited by a moderator:
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

 
I can't find any bug on 1.1 tested alot of things... even the warnings i gets is gone.

 
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

 
Last edited by a moderator:
@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.

 
The patch already has those inside,

Code:
+	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;+	}
 
Code:
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
 
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.

 
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.

 
Back
Top