Jump to content
AnnieRuru

Charms

Recommended Posts

If there's 2 jellopy on hand, will it stack the effect? Can we have an option for 'stackable' or non-stackable effects?

Edited by Kong

Share this post


Link to post
Share on other sites

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 actually

maybe can add another field "Stack_Charm: true" to only give 1 effect per item ID

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

as always, thank you ma'am..  :wub:

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Thank you! :D

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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. :)

 

post-1961-0-93378300-1456487866_thumb.png

Share this post


Link to post
Share on other sites

 

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. :)

 

attachicon.gifUntitled.png

 

@@Dastgir might be able to update it for us if he got any free time  :wub:  :wub:

Share this post


Link to post
Share on other sites

 

 

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. :)

 

attachicon.gifUntitled.png

 

@@Dastgir might be able to update it for us if he got any free time  :wub:  :wub:

My Free Times comes too late :( :(

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

Share this post


Link to post
Share on other sites

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

 

On 7/29/2016 at 3:25 AM, madalilng said:

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

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
On 12/27/2015 at 9:34 AM, AnnieRuru said:

nonono ... don't worry
this plugin DOES NOT DUP ITEM, trust me :P

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; "> },


{
	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 reprep_up.pngup Dastgir's post in this topic
because I copy paste most of his stuffs

 

  Reveal hidden contents

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?

Share this post


Link to post
Share on other sites

update to version 1.4, as this one also has nocharms mapflag, similar issue as noitem mapflag

https://github.com/AnnieRuru/Release/blob/master/plugins/Charms/charms_1.4.c

- fix memory leak when do multiple `@loadnpc`

 

On 8/4/2019 at 1:18 AM, iubantot said:

Is it possible to add a status icon when a certain charm is present in your inventory?

well yes, actually you also can do it on any equipment, not just charms

however I don't want to add unnecessary feature on public release version,

this could be done if open a new topic on plugin request though

 

EDIT: Eddga_Card

{
	Id: 4123
	AegisName: "Eddga_Card"
	Name: "Eddga Card"
	Type: "IT_CARD"
	Buy: 20
	Weight: 10
	Loc: "EQP_SHOES"
	Script: <" bonus bMaxHPrate,-25; ">
	OnEquipScript: <" sc_start4 SC_ENDURE,60000,10,0,0,1; ">
	OnUnequipScript: <" sc_end SC_ENDURE; ">
},

hmm ..............................

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
charm.c: In function 'npc_parse_unknown_mapflag_pre':
charm.c:173:31: warning: declaration of 'cidata' shadows a previous local [-Wshadow]
       struct charm_item_data *cidata = getFromITEMDATA(idata, 0);
                               ^
charm.c:131:26: warning: shadowed declaration is here [-Wshadow]
  struct charm_item_data *cidata = NULL;
                          ^
charm.c:131:26: warning: unused variable 'cidata' [-Wunused-variable]

Some minor warning :D

Share this post


Link to post
Share on other sites

1.5 - plugin

- fix warning shown on linux compiler

- add OnEquipScript and OnUnequipScript support

 

see 1st post for more information

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.