Jump to content

Recommended Posts

I'd like to know how I could stack affect.add ? 

At the moment , the function work only once, it does not stack if another affect.add is added over .

How can I make it work?

OR, is there any other way to give a permanent bonus to the player  which stacks?

Link to comment
https://metin2.dev/topic/16447-how-to-stack-affectadd-or-other-ways/
Share on other sites

Acum 6 ore, ElBrujoo a spus:

If you want a bonus that is stacked like chaegirab you can use affect.add_collect(), i think it s the simplest way

It doesn't stack.

affect.add_collect() + affect.add_collect() = don't stack

affect.add_collect() + affect.add() = stack ONCE 

I need them to be stacking more, like affect.add_collect() + affect.add_collect() + affect.add_collect() + affect.add_collect() and so on

19 hours ago, HisaoShou said:

It doesn't stack.

affect.add_collect() + affect.add_collect() = don't stack

affect.add_collect() + affect.add() = stack ONCE 

I need them to be stacking more, like affect.add_collect() + affect.add_collect() + affect.add_collect() + affect.add_collect() and so on

That's EXACTLY what the affect.add_collect() is supposed to do. However to be 100% sure I tested and it worked stacking a bonus. If you still can't make it work I could help you on skype-> xelbrujoox

Acum 2 ore, ElBrujoo a spus:

That's EXACTLY what the affect.add_collect() is supposed to do. However to be 100% sure I tested and it worked stacking a bonus. If you still can't make it work I could help you on skype-> xelbrujoox

Ok , then try to stack exactly the same values. 

Try this:  affect.add_collect(apply.INT,10,60*60*24*300*59) + affect.add_collect(apply.INT,10,60*60*24*300*59) + affect.add_collect(apply.INT,10,60*60*24*300*59)

It won't stack more than two times.

Maybe your affect collect function is not the same as mine but i don t think that s the case. I ve tested however and all works:
Before all:

Spoiler

d7dfa78de8d247d823a45514f74418ac.png

Then the npc:

Spoiler

163742399584b484db2edf86aece636b.png

I pressed "Stack mob":

Spoiler

2bf197c16fb946d35385f187d42e366b.png

and then the stack mob 2:

Spoiler

bf68cfd3e3f3cee1f41738ff536987c7.jpg

what they do is this:

        when 20094.chat."stack mob" begin
            say("Ok")
            affect.add_collect(apply.INT,10,60*60*24*300*59)
        end

        when 20094.chat."stack mob 2" begin
            say("Ok")
            affect.add_collect(apply.INT,10,60*60*24*300*59)
            affect.add_collect(apply.INT,10,60*60*24*300*59)
            affect.add_collect(apply.INT,10,60*60*24*300*59)
        end

 

If u need help i'll wait you on skype

 

PS: by the way I pressed the mob stack two times more, the stack 2 added only 30 int.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Honorable Member

questlua_affect.cpp

search for: int affect_add(lua_State * L)

delete this part:

 

if (ch->FindAffect(AFFECT_QUEST_START_IDX, applyOn)) // 퀘스트로 인해 같은 곳에 효과가 걸려있으면 스킵
  return 0;
  • Love 2

992404397646696589.png
Former C++ Developer at Gameloft on DML
Join my Discord: Distraught Labs

  • 4 years later...

Can i refresh this topic?
Im trying to stack by affect_collect, i even deleted part above and bonuses dont stack.
It wont stack if i get same bonus value, for example: 10 movement speed,
i can take 2x 10 movement and get 20, but if i relog, teleport to other map bonuses are reset to 10
i can stack different values, 1 2 3 4 5 etc
but if i add 1 2 3 5 5 6 7 6 then i will get only 24

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.