mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-02 02:15:48 -04:00
67 lines
2.2 KiB
Java
67 lines
2.2 KiB
Java
package script.event.halloween;
|
|
|
|
import script.*;
|
|
import script.base_class.*;
|
|
import script.combat_engine.*;
|
|
import java.util.Arrays;
|
|
import java.util.Hashtable;
|
|
import java.util.Vector;
|
|
import script.base_script;
|
|
|
|
import script.library.sui;
|
|
import script.library.utils;
|
|
|
|
public class song_book extends script.base_script
|
|
{
|
|
public song_book()
|
|
{
|
|
}
|
|
public static final String HALLOWEEN = new String("event/halloween");
|
|
public static final string_id SID_USE = new string_id(HALLOWEEN, "learn_song");
|
|
public static final string_id CANT_USE = new string_id(HALLOWEEN, "not_entertainer");
|
|
public static final string_id LEARNED_SONG = new string_id(HALLOWEEN, "learned_song");
|
|
public static final string_id CANT_USE_LOW_LEVEL = new string_id(HALLOWEEN, "not_entertainer_enough");
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
|
{
|
|
menu_info_data data = mi.getMenuItemByType(menu_info_types.SERVER_MENU1);
|
|
if (utils.isNestedWithin(self, player))
|
|
{
|
|
if (utils.isProfession(player, utils.ENTERTAINER))
|
|
{
|
|
if (!hasCommand(player, "startMusic+dirge"))
|
|
{
|
|
mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_USE);
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
|
{
|
|
if (utils.isNestedWithin(self, player))
|
|
{
|
|
if (item == menu_info_types.SERVER_MENU1)
|
|
{
|
|
if (utils.isProfession(player, utils.ENTERTAINER))
|
|
{
|
|
if (getLevel(player) > 81)
|
|
{
|
|
grantCommand(player, "startMusic+dirge");
|
|
sendSystemMessage(player, LEARNED_SONG);
|
|
destroyObject(self);
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(player, CANT_USE_LOW_LEVEL);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(player, CANT_USE);
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|