strutZ
Australian OT Member {AKA Beastn}
- Joined
- Nov 16, 2014
- Messages
- 1,393
- Solutions
- 7
- Reaction score
- 552
Hey otland,
I'm working on my next modal window script for TFS 1.1 - 1.2, The idea is the player can either use an item or put money/item on a table use lever and he can select a raid from a modalwindow and start it.
I cant seem to find the command to start a raid? i have found this in my command.cpp
But i have no clue how to use it.. I'm starting to think that i will need to edit sources if i want this to happen? any help would be awesome. Thanks.
I'm working on my next modal window script for TFS 1.1 - 1.2, The idea is the player can either use an item or put money/item on a table use lever and he can select a raid from a modalwindow and start it.
I cant seem to find the command to start a raid? i have found this in my command.cpp
Code:
void Commands::forceRaid(Player& player, const std::string& param)
{
Raid* raid = g_game.raids.getRaidByName(param);
if (!raid || !raid->isLoaded()) {
player.sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "No such raid exists.");
return;
}
if (g_game.raids.getRunning()) {
player.sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Another raid is already being executed.");
return;
}
g_game.raids.setRunning(raid);
RaidEvent* event = raid->getNextRaidEvent();
if (!event) {
player.sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The raid does not contain any data.");
return;
}
raid->setState(RAIDSTATE_EXECUTING);
uint32_t ticks = event->getDelay();
if (ticks > 0) {
g_scheduler.addEvent(createSchedulerTask(ticks, std::bind(&Raid::executeRaidEvent, raid, event)));
} else {
g_dispatcher.addTask(createTask(std::bind(&Raid::executeRaidEvent, raid, event)));
}
player.sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Raid started.");
}
But i have no clue how to use it.. I'm starting to think that i will need to edit sources if i want this to happen? any help would be awesome. Thanks.