Jump to content
  • 0

Delay for Token of Siegfried


Innos

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  62
  • Reputation:   5
  • Joined:  08/23/17
  • Last Seen:  

Hello all,

I want put in my Token of Siegfried Item (7621) a delay from 60minutes.

in my db/item_delay.txt is write:

// Item Delay Database

// Max number of entries is defined in itemdb.h as MAX_ITEMDELAYS

//

// Structure:

// Item ID,Delay in Milliseconds

//PRO Shop

7621,3600000 // Token_Of_Siegfried

but it doesn't work. The Ressurection button comes always. What can i do?!

i think for an Src Edit?

/// Request to resurrect oneself using Token of Siegfried (CZ_STANDING_RESURRECTION).
/// 0292
void clif_parse_AutoRevive(int fd, struct map_session_data *sd)
{
int item_position = pc_search_inventory(sd, ITEMID_TOKEN_OF_SIEGFRIED);
if (item_position < 0)
 return;
if (sd->sc.data[sC_HELLPOWER]) //Cannot res while under the effect of SC_HELLPOWER.
 return;
if (!status_revive(&sd->bl, 100, 100))
 return;

clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
pc_delitem(sd, item_position, 1, 0, 1);
}

but i don't know how can i do it.

thx for help

LG

Divine

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Development Manager
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  732
  • Reputation:   525
  • Joined:  12/13/11
  • Last Seen:  

The reason is because the item delay database is for usable items rather than etc items.

You'll have to hard code a delay for the item. Adjust the the clif_parse_AutoRevive() function to be like this:

void clif_parse_AutoRevive(int fd, struct map_session_data *sd)
{
int item_position = pc_search_inventory(sd, 7621);

if (item_position < 0)
	return;

if (sd->sc.data[sC_HELLPOWER]) //Cannot res while under the effect of SC_HELLPOWER.
	return;

if (!status_revive(&sd->bl, 100, 100))
	return;

if (DIFF_TICK(gettick(), pc_getglobalreg(sd,"TOKEN_OF_SIEGFRIED")) < 3600000)
	return;

pc_setglobalreg(sd,"TOKEN_OF_SIEGFRIED",gettick());
clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
pc_delitem(sd, item_position, 1, 0, 1);
}

That stores a normal variable to each player who uses the item. (Same as using "set TOKEN_OF_SIEGFRIED,<current time in milliseconds>;" if you used it as a NPC).

Edited by Aleos
  • Love 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

another way....not sure correct or not..

void clif_parse_AutoRevive(int fd, struct map_session_data *sd)
{
int diff;
time_t timer;
struct tm *t;
time(&timer);
t = localtime(&timer);
diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, "REVIVE_DELAY");
int item_position = pc_search_inventory(sd, ITEMID_TOKEN_OF_SIEGFRIED);
if(  diff >= 0 && diff < battle_config.revive_interval )
return;
if (item_position < 0)
 return;
if (sd->sc.data[sC_HELLPOWER]) //Cannot res while under the effect of SC_HELLPOWER.
 return;
if (!status_revive(&sd->bl, 100, 100))
 return;
clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
pc_delitem(sd, item_position, 1, 0, 1);
pc_setglobalreg(sd,"REVIVE_DELAY", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);
}

i try to copy the way for Duel Delay xD

add this inside the

conf/battle/misc.conf

// Delay between using Token of Siegfried in minutes[/color]
[color=#000000]revive_interval: 60
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  62
  • Reputation:   5
  • Joined:  08/23/17
  • Last Seen:  

Okay, thanks.

I tested, but i'm too noob in src.

@Emistry:

i used your Code. but i haven't "battle_config.revive_interval", so i put in

battle.h

	
int mail_show_status;
int client_limit_unit_lv;
+ int revive_interval;

and

battle.c

	
{ "mail_show_status",				   &battle_config.mail_show_status,				0,	  0,	  2,			  },
{ "client_limit_unit_lv",			   &battle_config.client_limit_unit_lv,			0,	  0,	  BL_ALL,		 },
+ { "revive_interval",					&battle_config.revive_interval,				 0,	  0,	  INT_MAX,		},

wrong ?!

Than after i recompile i become error:

11>e:\promrv4\src\map\clif.c(13223): error C2143: Syntaxfehler: Es fehlt ';' vor 'Typ'

11>e:\promrv4\src\map\clif.c(13226): error C2065: 'item_position': nichtdeklarierter Bezeichner

11>e:\promrv4\src\map\clif.c(13233): error C2065: 'item_position': nichtdeklarierter Bezeichner

Error @ Aleos:

11>e:\promrv4\src\map\clif.c(13227): warning C4013: 'pc_getglobalreg' undefiniert; Annahme: extern mit Rückgabetyp int

11>clif.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_pc_getglobalreg" in Funktion "_clif_parse_AutoRevive".

/ok

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

×
×
  • Create New...