AnnieRuru 957 Posted December 27, 2015 (edited) Download: 1.6plugin 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 mapflaghttp://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 repup 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 Edited November 12, 2020 by AnnieRuru 10 Samuel, REKT, Ehwaz and 7 others reacted to this Quote Share this post Link to post Share on other sites
wallaby 1 Posted December 27, 2015 Thanks so much Annie!!! Quote Share this post Link to post Share on other sites
Kong 9 Posted December 27, 2015 (edited) If there's 2 jellopy on hand, will it stack the effect? Can we have an option for 'stackable' or non-stackable effects? Edited December 27, 2015 by Kong 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted December 27, 2015 (edited) 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 Edited December 27, 2015 by AnnieRuru Quote Share this post Link to post Share on other sites
Litro 45 Posted December 27, 2015 as always, thank you ma'am.. 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 Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted December 27, 2015 yes, that member is hemagx http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC I already updated the wiki and many people complain about the pink color notepad++ lol Quote Share this post Link to post Share on other sites
Litro 45 Posted December 27, 2015 yes, that member is hemagx http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC I already updated the wiki and many people complain about the pink color notepad++ lol ouch... that okay for me, won't complain about it look like you will dye herc pink sooner or later Thanks Litro Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted December 27, 2015 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 2 jTynne and Kong reacted to this Quote Share this post Link to post Share on other sites
REKT 10 Posted December 27, 2015 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! Quote Share this post Link to post Share on other sites
xlaws27 3 Posted December 29, 2015 @@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? Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted December 29, 2015 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 Quote Share this post Link to post Share on other sites
Helena 0 Posted February 26, 2016 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. Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted February 28, 2016 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. Untitled.png @@Dastgir might be able to update it for us if he got any free time 1 Helena reacted to this Quote Share this post Link to post Share on other sites
Helena 0 Posted March 13, 2016 Aaw Annie, Dastgir, where art thou? Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted June 15, 2016 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. Untitled.png @@Dastgir might be able to update it for us if he got any free time My Free Times comes too late :( Anyways, Here it is: https://github.com/dastgir/HPM-Plugins/blob/master/src/plugins/CharmSystem.c 3 fourxhackd, evilpuncker and Helena reacted to this Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted June 15, 2016 @Dastgir better late than never <3 we love you, thanks! Quote Share this post Link to post Share on other sites
madalilng 0 Posted July 28, 2016 how about charm max stack? for example it only stacks with 5 jellopy... Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted March 24, 2019 (edited) 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 March 24, 2019 by AnnieRuru 1 Kuroe reacted to this Quote Share this post Link to post Share on other sites
iubantot 0 Posted August 3, 2019 On 12/27/2015 at 9:34 AM, AnnieRuru said: nonono ... don't worry this plugin DOES NOT DUP ITEM, trust me Download: 1.3plugin 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 mapflaghttp://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 repup 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? Quote Share this post Link to post Share on other sites
hadiesyafiq 7 Posted February 1, 2020 how about script callfunc ?still need to click right? Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted February 1, 2020 Charms run everything inside "Script" tag when item is in inventory Quote Share this post Link to post Share on other sites
hadiesyafiq 7 Posted February 1, 2020 Thank you @AnnieRuru and @Dastgir...all work now Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted September 30, 2020 (edited) 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 September 30, 2020 by AnnieRuru Quote Share this post Link to post Share on other sites
astralprojection 35 Posted November 11, 2020 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 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted November 12, 2020 1.5 - plugin - fix warning shown on linux compiler - add OnEquipScript and OnUnequipScript support see 1st post for more information Quote Share this post Link to post Share on other sites