Jump to content
  • 0

Status Effects and Icons


Pneuma

Question


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

Hello :o I'm wondering how do I display or give a player a status effect permanently until it is removed by an NPC; Mainly in the db/const.txt the SI_ section

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Use a large number on the time value

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

if for client-effect only, maybe make a script command for like

displayeffect <SI>,<duration>;

and it has

clif_status_change(&sd->bl,script_getnum(st,2),0,script_getnum(st,3),0,0,0);

permanent duration is -1, or maybe u can put the script OnPCStatCalcEvent

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

Use a large number on the time value

if for client-effect only, maybe make a script command for like

displayeffect <SI>,<duration>;
and it has

clif_status_change(&sd->bl,script_getnum(st,2),0,script_getnum(st,3),0,0,0);
permanent duration is -1, or maybe u can put the script OnPCStatCalcEvent
bonus_script "{bonus bStr,1; bonus bVit,1; bonus bMaxHP,30; bonus bMaxSP,10;}",-1,8,0,SI_swordclan;
^Thats what I need it for but sadly -1 wont make it permanent and I need it so there is no timer :/ Edited by Pneuma
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

currently, check that bonus_script on script.c not available for that permanent/-1 duration. :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

currently, check that bonus_script on script.c not available for that permanent/-1 duration. :P

BUILDIN_FUNC(bonus_script) {
	uint8 i, flag = 0;
	int16 icon = SI_BLANK;
	uint32 dur;
	char type = 0;
	TBL_PC* sd;
	const char *script_str = NULL;
	struct script_code *script = NULL;

	if (script_hasdata(st,7))
		sd = map_charid2sd(script_getnum(st,7));
	else
		sd = script_rid2sd(st);

	if (sd == NULL)
		return SCRIPT_CMD_FAILURE;
	
	script_str = script_getstr(st,2);
	dur = 1000 * abs(script_getnum(st,3));
	FETCH(4,flag);
	FETCH(5,type);
	FETCH(6,icon);

	if (script_str[0] == '\0' || !dur) {
		//ShowWarning("buildin_bonus_script: Invalid script. Skipping...\n");
		return SCRIPT_CMD_FAILURE;
	}

	//Skip duplicate entry
	ARR_FIND(0,MAX_PC_BONUS_SCRIPT,i,&sd->bonus_script[i] && sd->bonus_script[i].script_str && strcmp(sd->bonus_script[i].script_str,script_str) == 0);
	if (i < MAX_PC_BONUS_SCRIPT) {
		//ShowWarning("buildin_bonus_script: Duplicate entry with bonus '%d'. Skipping...\n",i);
		return SCRIPT_CMD_SUCCESS;
	}

	if (!(script = parse_script(script_str,"bonus_script",0,1))) {
		ShowWarning("buildin_bonus_script: Failed to parse script '%s' (cid:%d). Skipping...\n",script_str,sd->status.char_id);
		return SCRIPT_CMD_FAILURE;
	}

	//Find the empty slot
	ARR_FIND(0,MAX_PC_BONUS_SCRIPT,i,!sd->bonus_script[i].script);
	if (i >= MAX_PC_BONUS_SCRIPT) {
		ShowWarning("buildin_itemscript: Maximum script_bonus is reached (cid:%d max: %d). Skipping...\n",sd->status.char_id,MAX_PC_BONUS_SCRIPT);
		return SCRIPT_CMD_SUCCESS;
	}

	//Add the script data
	memcpy(sd->bonus_script[i].script_str,script_str,strlen(script_str)+1);
	sd->bonus_script[i].script = script;
	sd->bonus_script[i].tick = gettick() + dur;
	sd->bonus_script[i].flag = flag;
	sd->bonus_script[i].type = type;
	sd->bonus_script[i].icon = icon;

	if (sd->bonus_script[i].icon != SI_BLANK) //Gives status icon if exist
		clif_status_change(&sd->bl,sd->bonus_script[i].icon,1,dur,1,0,0);

	status_calc_pc(sd,false);
	return SCRIPT_CMD_SUCCESS;
}

^The bonus_script section; But I dont know what you mean xD

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