mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
49 lines
1.6 KiB
Plaintext
49 lines
1.6 KiB
Plaintext
/********************************************************************************************************************************************
|
|
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
|
|
* All Rights Reserved
|
|
*
|
|
* Title: jedi_robe.script
|
|
* Description: Jedi wearables script, allowing the appropriate ranks to equip various wearables.
|
|
* @author Benjamin Norris
|
|
* @version $Revision:$
|
|
**********************************************************************/
|
|
|
|
|
|
/***** INCLUDES ********************************************************/
|
|
include library.force_rank;
|
|
include library.prose;
|
|
include library.utils;
|
|
include library.jedi;
|
|
include library.static_item;
|
|
|
|
/***** CONSTANTS *******************************************************/
|
|
const string VAR_JEDI_SKILL = "jedi.skill_required";
|
|
const string VAR_ROBE_REGEN = "jedi.robe.regen";
|
|
const string VAR_ROBE_POWER = "jedi.robe.power";
|
|
|
|
const string_id SID_MUST_BE_HIGHER_RANK = new string_id("jedi_spam", "must_be_higher_rank");
|
|
|
|
/***** TRIGGERS ********************************************************/
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
|
|
if(!static_item.isStaticItem(self))
|
|
{
|
|
string templateName = getTemplateName(self);
|
|
if(templateName == "object/tangible/wearables/robe/robe_jedi_padawan.iff")
|
|
{
|
|
obj_id player = utils.getContainingPlayer(self);
|
|
if (isIdValid(player))
|
|
{
|
|
obj_id inventory = utils.getInventoryContainer(player);
|
|
destroyObject(self);
|
|
static_item.createNewItemFunction("item_jedi_robe_padawan_04_01",player);
|
|
}
|
|
}
|
|
else
|
|
destroyObject(self);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
} |