Charms

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



tested with

{
Id: 909
AegisName: "Jellopy"
Name: "Jellopy"
Buy: 6
Weight: 10
BuyingStore: true
Charm: true
// Charm_Stack: true
Script: <" bonus bStr, 10000; ">
OnEquipScript: <"
sc_start4 SC_ENDURE,60000,10,0,0,1;
hateffect HAT_EF_BOTTOM_BLOODYLUST, true;
">
OnUnequipScript: <"
sc_end SC_ENDURE;
hateffect HAT_EF_BOTTOM_BLOODYLUST, false;
">

// OnRentalStartScript: <" dispbottom "rent start"; ">
// OnRentalEndScript: <" dispbottom "rent end"; ">
},


just having Jellopy inside inventory will get bonus
Remember: it has to use IT_ETC type item, which has been default to type 3 if you didn't specify
and also "Charm: true" flag

if added the "Charm_Stack: true" flag, the charms will stack
- if the flag is false (default), having 10 same charms will give bonus 10 times, because they are separate items
- if the flag is true, having 10 same charms will only give bonus once, because they are stack together

version 1.3 onwards, added nocharms mapflag
http://herc.ws/board/topic/15219-modification-to-noitem-plugin/
to disable charms bonuses given in certain maps

prontera mapflag nocharms


disable all charms from taking effect on the map

prontera mapflag nocharms 909
prontera mapflag nocharms Jellopy


disable only this 'Jellopy' charm from giving bonus

version 1.5 onwards, added OnEquipScript and OnUnequipScript support

now you can gives permanent SC_ENDURE bonus like eddga card like effect

or gives hateffect bonus like the example shown
 



credit to digitalhamster
in case you guys forgotten, I fixed digitalhamster's patch on eathena forum 4 years ago

and the one in rathena also credited my name

and if you like this plugin, remember to also rep
rep_up.png
up Dastgir's post in this topic
because I copy paste most of his stuffs

1.0 - plugin
- use the Charm: true flag, credit to Dastgir
- use a player variable trick to prevent duplicate the item
--- because if run status_calc_pc before the memset into NULL, the item data is not clear, thus can duplicate items

1.1 - plugin
- added Charm_Stack: true flag, credit to Litro and Kong for the idea
- however it always run the status_calc_pc even if the player still having the item in the inventory

1.2 - plugin
- fix the errors only

1.3 - plugin
- update to latest revision
- add nochams mapflag to deny giving item bonus

1.4 - plugin

- fix memory leak when do multiple `@loadnpc`

1.5 - plugin

- fix warning shown on linux compiler

- add OnEquipScript and OnUnequipScript support

1.6 - plugin

- fix it run status_calc_pc on every charms pickup and drop

- fix OnEquipScript doesn't run when player login

- fix nullpo, it wasn't needed at all
 
Last edited by a moderator:
If there's 2 jellopy on hand, will it stack the effect? Can we have an option for 'stackable' or non-stackable effects?

 
Last edited by a moderator:
If there's 2 jellopy on hand, will it stack the effect?
yes,when I test, having 2 jellopy, my str bonus become +20000

.

.

Can we have an option for 'stackable' or non-stackable effects?
nice idea actuallymaybe can add another field "Stack_Charm: true" to only give 1 effect per item ID

 
Last edited by a moderator:
as always, thank you ma'am.. 
default_wub.png


OOT:

are you using visual studio ma'am ? and in other topic there is saying (forgot who is saying this) the project (plugin project (sample plugin project)) can be copy pasted to make other plugin to work, are you using this method? if yes can you make tutorial about it? the lazy and ungrateful me is always have to open wiki to get the plugin to work

 
upload version 1.1

https://drive.google.com/file/d/0B2BM920mmHQganoxY0hTUktkUzQ/view

please make do with the google drive, because I accidentally upload the paste without log in

- added Charm_Stack: true flag, credit to Litro and Kong for the idea

- however it always run the status_calc_pc even if the player still having the item in the inventory

and I'm going to watch star wars on the theater now

 
@@AnnieRuru

hi annieruru im planning to implement this in my live server, before i i put this in my server i just want to ask if this plugin is a complete no bug? or safe to use in a live server?

 
I think its safe,

since the day I fixed that digitalhanster's patch on eathena forum,

I never heard anything wrong about that

and I'm sure that patch is still used by many rathena server out there

the one made by dastgir can dup item,

because originally, the status_calc_pc should run AFTER the item deleted,

but he made it run before the item deleted, thus it never has the chance to run memset into null

https://github.com/HerculesWS/Hercules/blob/22d3fac0c9a9c39a4f3b544867ba1de4d8d2ecaa/src/map/pc.c#L4553-L4554

the item memory is still there thus can duplicate the item

I solved it with a little trick, its on the comment

I just tested with the *mergeitem script command

yup, I also can't reproduce any bug

with the "Charm_Stack: false", I have 10 jellopy, the merge window doesn't show the jellopy

 
I think its safe,

since the day I fixed that digitalhanster's patch on eathena forum,

I never heard anything wrong about that

and I'm sure that patch is still used by many rathena server out there

the one made by dastgir can dup item,

because originally, the status_calc_pc should run AFTER the item deleted,

but he made it run before the item deleted, thus it never has the chance to run memset into null

https://github.com/HerculesWS/Hercules/blob/22d3fac0c9a9c39a4f3b544867ba1de4d8d2ecaa/src/map/pc.c#L4553-L4554

the item memory is still there thus can duplicate the item

I solved it with a little trick, its on the comment

I just tested with the *mergeitem script command

yup, I also can't reproduce any bug

with the "Charm_Stack: false", I have 10 jellopy, the merge window doesn't show the jellopy

Hi Annie, the console gives an error when i make plugins

Any idea what it is? I'm using charms 1.1 Thanks a lot for the release btw.
default_smile.png


Untitled.png

 
I think its safe,

since the day I fixed that digitalhanster's patch on eathena forum,

I never heard anything wrong about that

and I'm sure that patch is still used by many rathena server out there

the one made by dastgir can dup item,

because originally, the status_calc_pc should run AFTER the item deleted,

but he made it run before the item deleted, thus it never has the chance to run memset into null

https://github.com/HerculesWS/Hercules/blob/22d3fac0c9a9c39a4f3b544867ba1de4d8d2ecaa/src/map/pc.c#L4553-L4554

the item memory is still there thus can duplicate the item

I solved it with a little trick, its on the comment

I just tested with the *mergeitem script command

yup, I also can't reproduce any bug

with the "Charm_Stack: false", I have 10 jellopy, the merge window doesn't show the jellopy

Hi Annie, the console gives an error when i make plugins

Any idea what it is? I'm using charms 1.1 Thanks a lot for the release btw.
default_smile.png


attachicon.gif
Untitled.png
@@Dastgir might be able to update it for us if he got any free time 
default_wub.png
 
default_wub.png


 
I think its safe,

since the day I fixed that digitalhanster's patch on eathena forum,

I never heard anything wrong about that

and I'm sure that patch is still used by many rathena server out there

the one made by dastgir can dup item,

because originally, the status_calc_pc should run AFTER the item deleted,

but he made it run before the item deleted, thus it never has the chance to run memset into null

https://github.com/HerculesWS/Hercules/blob/22d3fac0c9a9c39a4f3b544867ba1de4d8d2ecaa/src/map/pc.c#L4553-L4554

the item memory is still there thus can duplicate the item

I solved it with a little trick, its on the comment

I just tested with the *mergeitem script command

yup, I also can't reproduce any bug

with the "Charm_Stack: false", I have 10 jellopy, the merge window doesn't show the jellopy

Hi Annie, the console gives an error when i make plugins

Any idea what it is? I'm using charms 1.1 Thanks a lot for the release btw.
default_smile.png


attachicon.gif
Untitled.png
@@Dastgir might be able to update it for us if he got any free time 
default_wub.png
 
default_wub.png
My Free Times comes too late
default_sad.png
:(

Anyways, Here it is: https://github.com/dastgir/HPM-Plugins/blob/master/src/plugins/CharmSystem.c

 
@Dastgir better late than never <3 we love you, thanks!

 
1.3 - plugin
- update to latest revision
- add nochams mapflag to deny giving item bonus

how about charm max stack?

for example it only stacks with 5 jellopy...
I don't really know how to do this, because force serial is like ... giving items in bulk immediately
getitem 909, 5; ... click on this will give 5 in 1 set, click repeatedly will give multiple sets
if getitem 909, 9; means have to give 5+4 charms, giving 2 times bonus ?

because the item stack actually means, giving multiple bonuses ...

EDIT:



I think I'm starting to get it, its the same as having 30000 MAX_AMOUNT in the inventory (MAX_AMOUNT = defined in mmo.h)
if player having 35000 amount, it automatically split into 30000 and 5000, giving twice the bonus
so instead of having MAX_AMOUNT 30000, add another field Charm_Max_Stack to have a maximum stack 5, which can be configurable

 
Last edited by a moderator:
nonono ... don't worry
this plugin DOES NOT DUP ITEM, trust me
default_tongue.png


Download: 1.3
plugin

tested with

{
Id: 909
AegisName: "Jellopy"
Name: "Jellopy"
Buy: 6
Weight: 10
BuyingStore: true
Charm: true
// Charm_Stack: true
Script: <" bonus bStr, 10000; ">
},

Code:
{
	Id: 909
	AegisName: "Jellopy"
	Name: "Jellopy"
	Buy: 6
	Weight: 10
	BuyingStore: true
	Charm: true
//	Charm_Stack: true
	Script: <" bonus bStr, 10000; ">
},
just having Jellopy inside inventory will get bonus
Remember: it has to use IT_ETC type item, which has been default to type 3 if you didn't specify
and also "Charm: true" flag

if added the "Charm_Stack: true" flag, the charms will stack
- if the flag is false (default), having 10 same charms will give bonus 10 times, because they are separate items
- if the flag is true, having 10 same charms will only give bonus once, because they are stack together

version 1.3 onwards, added nocharms mapflag
http://herc.ws/board/topic/15219-modification-to-noitem-plugin/
to disable charms bonuses given in certain maps

prontera mapflag nocharms

prontera mapflag nocharms


disable all charms from taking effect on the map

prontera mapflag nocharms 909
prontera mapflag nocharms Jellopy

prontera mapflag nocharms 909
prontera mapflag nocharms Jellopy


disable only this 'Jellopy' charm from giving bonus
 

credit to digitalhamster
in case you guys forgotten, I fixed digitalhamster's patch on eathena forum 4 years ago

and if you like this plugin, remember to also rep
rep_up.png
up Dastgir's post in this topic
because I copy paste most of his stuffs

1.0 - plugin
- use the Charm: true flag, credit to Dastgir
- use a player variable trick to prevent duplicate the item
--- because if run status_calc_pc before the memset into NULL, the item data is not clear, thus can duplicate items

1.1 - plugin
- added Charm_Stack: true flag, credit to Litro and Kong for the idea
- however it always run the status_calc_pc even if the player still having the item in the inventory

1.2 - plugin
- fix the errors only

1.3 - plugin
- update to latest revision
- add nochams mapflag to deny giving item bonus
Is it possible to add a status icon when a certain charm is present in your inventory?

 
Back
Top