35 lines
969 B
Plaintext
35 lines
969 B
Plaintext
|
|
void main()
|
|
{
|
|
object oClicker = GetClickingObject();
|
|
object oTarget = GetTransitionTarget(OBJECT_SELF);
|
|
object oArea = GetArea(oClicker);
|
|
object oMob;
|
|
int iFights;
|
|
int iFlag;
|
|
|
|
iFlag = TRUE;
|
|
|
|
oMob = GetFirstObjectInArea(oArea);
|
|
while (GetIsObjectValid(oMob))
|
|
{
|
|
if (GetObjectType(oMob) == OBJECT_TYPE_CREATURE && !GetIsPC(oMob) && !GetIsPC(GetMaster(oMob)))
|
|
iFlag = FALSE;
|
|
oMob = GetNextObjectInArea(oArea);
|
|
}
|
|
|
|
if (iFlag == TRUE)
|
|
{
|
|
GiveGoldToCreature(oClicker,GetHitDice(oClicker) * 25);
|
|
iFights=GetLocalInt(oClicker,"PCFights");
|
|
iFights++;
|
|
SetLocalInt(oClicker,"HTCArena",0);
|
|
SetLocalInt(oClicker,"PCFights",iFights);
|
|
SetLocalInt(oClicker,"ArenaHasFought",1);
|
|
if (GetLocalInt(oClicker,"QuestFights") > 0 && GetLocalInt(oClicker,"QuestFights") > iFights)
|
|
SetLocalInt(oClicker,"ArenaHasFought",0);
|
|
SetAreaTransitionBMP(AREA_TRANSITION_RANDOM);
|
|
AssignCommand(oClicker,JumpToObject(oTarget));
|
|
}
|
|
}
|