Jump to content
  • 0

How can I add bonus item when you're in a specific map?


Question

Posted (edited)

Hello I'm new to src modification, I have this hourly system based on src, I would like to add bonus item if the player is on the specific map.
example i will get the hourly points but when im in Prontera map I will get the bonus item (potions).

Here's what in my src pc.cpp

		int64 hourly_points = pc_readregistry(sd, reference_uid(add_str(sd->hourly_system.point_name), 0));
            int64 get = hourly_points + sd->hourly_system.point;
            pc_setregistry(sd, reference_uid(add_str(sd->hourly_system.point_name), 0), get);
            char msg[CHAT_SIZE_MAX];
            sprintf(msg, "You Got [ %d ] Hourly Point , You have now [ %d ] Hourly Points.", sd->hourly_system.point , static_cast<int>(get));

Im new to src I dont know what are the scripts to type condition in src.
condition: if player is in prontera he's going to get bonus Siege Potion Box if not, just the normal hourly point

Edited by jmsngls

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

In this example the red potion will only take effect within the prontera map.

- Id: 501
  AegisName: Red_Potion
  Name: Red Potion
  Type: Healing
  Buy: 50
  Weight: 70
  Script: |
  if( strcharinfo(3) == "prontera" ){ itemheal rand(45,65),0; }

 

Please, as soon as you can, try to answer my question that I posted in your other topic. Thanks.

 

Edited by Fou-lu
  • 0
Posted (edited)

Hello, what I mean is players will receive bonus items like Siege Potion Box when doing hourly points

Here's what in my src pc.cpp

		int64 hourly_points = pc_readregistry(sd, reference_uid(add_str(sd->hourly_system.point_name), 0));
            int64 get = hourly_points + sd->hourly_system.point;
            pc_setregistry(sd, reference_uid(add_str(sd->hourly_system.point_name), 0), get);
            char msg[CHAT_SIZE_MAX];
            sprintf(msg, "You Got [ %d ] Hourly Point , You have now [ %d ] Hourly Points.", sd->hourly_system.point , static_cast<int>(get));

Im new to src I dont know what are the scripts to type condition in src.
condition: if player is in prontera he's going to get bonus Siege Potion Box if not, just the normal hourly point


@Fou-lu, regarding with your question on my topic, it was answered already ?

Edited by jmsngls

Join the conversation

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

Guest
Answer this question...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...