Jump to content

Clan level donate AI


Recommended Posts

Hi there, my first share :)
Long story short: I took piece of code from Mr. Parker (original thread: here) and reworked it for my needs.
Idea: player comes to donation NPC with a wish to increase clan level. If he is in clan (player does not need to be clan leader), clan level is not 8 and player has 25 Coin of Luck, clan level will be increased, if not - NPC will return an message (via Say).

 

Here is the snippet of code, I am sure everyone will fit it easily, basically it's plug and play :)

    if( ask == 123123 )
    {
      if( myself::OwnItemCount( talker, @coin_of_luck ) >= 25 )
      {
        if( talker.pledge_id != 0 )
        {
          i1 = myself::GetPledgeSkillLevel( talker );
          if( i1 != 8 )
          {
            myself::PledgeLevelUp( talker, reply );
            myself::DeleteItem1( talker, @coin_of_luck, 25 );
            myself::SoundEffect( talker, "ItemSound.quest_fanfare_2" );
            myself::Say( "" + talker.name + ", your clan is now at maximum level. GLHF!" );
            myself::ShowPage( talker, "misc_shop001.htm" );
            return;
          }
          else if( i1 + 1 > reply )
          {
            myself::Say( "Sorry, " + talker.name + " but your clan is already at max level." );
            myself::ShowPage( talker, "misc_shop001.htm" );
            return;
          }
        }
        else
        {
          myself::Say( "Sorry, " + talker.name + " but you do not have clan." );
          myself::ShowPage( talker, "misc_shop001.htm" );
          return;
        }
      }
      else
      {
        myself::Say( "Sorry, " + talker.name + " but you do not have 25 COL to continue." );
        myself::ShowPage( talker, "misc_shop001.htm" );
        return;
      }
    }

 

Credits: Mr.Parker and a little from me ;)

Link to comment
Share on other sites

  • 3 months later...
On 23/11/2017 at 7:18 AM, Griunvaldas said:

Hi there, my first share :)
Long story short: I took piece of code from Mr. Parker (original thread: here) and reworked it for my needs.
Idea: player comes to donation NPC with a wish to increase clan level. If he is in clan (player does not need to be clan leader), clan level is not 8 and player has 25 Coin of Luck, clan level will be increased, if not - NPC will return an message (via Say).

 

Here is the snippet of code, I am sure everyone will fit it easily, basically it's plug and play :)


    if( ask == 123123 )
    {
      if( myself::OwnItemCount( talker, @coin_of_luck ) >= 25 )
      {
        if( talker.pledge_id != 0 )
        {
          i1 = myself::GetPledgeSkillLevel( talker );
          if( i1 != 8 )
          {
            myself::PledgeLevelUp( talker, reply );
            myself::DeleteItem1( talker, @coin_of_luck, 25 );
            myself::SoundEffect( talker, "ItemSound.quest_fanfare_2" );
            myself::Say( "" + talker.name + ", your clan is now at maximum level. GLHF!" );
            myself::ShowPage( talker, "misc_shop001.htm" );
            return;
          }
          else if( i1 + 1 > reply )
          {
            myself::Say( "Sorry, " + talker.name + " but your clan is already at max level." );
            myself::ShowPage( talker, "misc_shop001.htm" );
            return;
          }
        }
        else
        {
          myself::Say( "Sorry, " + talker.name + " but you do not have clan." );
          myself::ShowPage( talker, "misc_shop001.htm" );
          return;
        }
      }
      else
      {
        myself::Say( "Sorry, " + talker.name + " but you do not have 25 COL to continue." );
        myself::ShowPage( talker, "misc_shop001.htm" );
        return;
      }
    }

 

Credits: Mr.Parker and a little from me ;)


Would u compile?

can be used on advext?

Niceshare. 

Link to comment
Share on other sites

On 2/28/2018 at 5:15 AM, DemonPB said:


Would u compile?

can be used on advext?

Niceshare. 

This goes to ai.obj at NPC class which you want to have such functionality, you can compile it with free tools lying around ;)

Not sure about Advext, however I see no reason why not (maybe it can't work if Advext does not support PledgeLevelUp or GetPledgeSkillLevel calls, but they should be there, if not, you can look at any High Priest AI and they will have all correct methods for you to copy and imply on your code

Edited by Griunvaldas
Link to comment
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.   Paste as plain text instead

  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.



  • Posts

    • Surprise, AZ LOVE Spells 📱 +1 (973_384_3997 in Best Love Spells   You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back. Get back your Ex-lover This service has been the reason of so many happy endings that you should consider it as a serious solution. Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back When you work with an expert, this spell works toward dissipating the negative energies that were kicked up between you and your ex so that reconciliation becomes a possibility. When you break up with someone, especially if things ended badly, it’s like having a thick fog between the two of you that prevents you from seeing the truth of each other. Anger, hurt, and resentment linger in the air and it’s difficult to remember the reasons you fell in love in the first place With this spell, you can restore your broken relationship. The fog will clear, and the sun will shine on both your hearts, warming you up and preparing you for a reunion. You love someone but this isn’t mutual? Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. Your husband or you wife is thinking about divorce but you don’t want this to happen? Order this service now to reinforce the bonds of your relationship and save your marriage. Get back your Ex-lover This service will make him/her realize that a divorce would be a mistake and will strengthen love and passion. With permanent results, this service will guarantee a long lasting marriage and will make you happy. The perfect service to break up a relationship you don’t think legitimate. Your lover has gone with someone else? You love someone but this person is already involved in a relationship? Don’t hesitate to break them up as this ritual and prayer is very powerful and will give very good results in a few weeks only  
    • Columbia, SC voodoo Spells  📱 (973_384_3997 Best love spells You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back. Get back your Ex-lover This service has been the reason of so many happy endings that you should consider it as a serious solution. Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back When you work with an expert, this spell works toward dissipating the negative energies that were kicked up between you and your ex so that reconciliation becomes a possibility. When you break up with someone, especially if things ended badly, it’s like having a thick fog between the two of you that prevents you from seeing the truth of each other. Anger, hurt, and resentment linger in the air and it’s difficult to remember the reasons you fell in love in the first place With this spell, you can restore your broken relationship. The fog will clear, and the sun will shine on both your hearts, warming you up and preparing you for a reunion. You love someone but this isn’t mutual? Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. Your husband or you wife is thinking about divorce but you don’t want this to happen? Order this service now to reinforce the bonds of your relationship and save your marriage. Get back your Ex-lover This service will make him/her realize that a divorce would be a mistake and will strengthen love and passion. With permanent results, this service will guarantee a long lasting marriage and will make you happy. The perfect service to break up a relationship you don’t think legitimate. Your lover has gone with someone else? You love someone but this person is already involved in a relationship? Don’t hesitate to break them up as this ritual and prayer is very powerful and will give very good results in a few weeks only  
    • Что ты за 2 года войны смогло сделать со своего дивана трансвеститка?) Твой высер нужно читать как: хрю-хрю-хрююю! Ибо большего ты не можешь сделать, поэтому слезливо хрюкаешь на форумах :D Или ты начало резко так хрюкать из за того что твой Оренбург затопило?) Карма она вездесущая и Каховская ГЕС себя не заставила ждать)  
    • Pig dog are you still alive? Are you still able to escape from the military registration and enlistment office? Well, nothing, either they will catch you and send you to be meat in a combat zone, or after the end of a special military operation, we will find and punish every degenerate. And you pig dog can’t hide anywhere. I will personally make sure that you cannot stay on the territory of the Russian Federation and Ukraine. By the way, don’t be offended by those who call you a pigdog. You are a descendant of Bandera’s followers, and the soldiers of Hitler’s Germany called them schweinehund   So.... 🤣
    • Hello, i purchased an interface and unfortunately i don't receive any support on this issue weeks now. Basically when you go at any Fortress (Baroy for example) and you hit anything your character stuck there hitting and you cannot quit, chat or do anything.   Is like client overflood by packets. If i remove the interface everything works fine. Anyone have any idea how to fix this or what could cause this? I can provide access to my interface which i bough but i think it's encrypted. Thanks.
  • Topics

×
×
  • Create New...