Exemplo n.º 1
0
void EnergyTurret::Deactivate() 
{
	Notify_OnGodmaShipEffect shipEff;
	shipEff.itemID = m_Item->itemID();
	shipEff.effectID = 10;
	shipEff.when = Win32TimeNow();
	shipEff.start = 0;
	shipEff.active = 0;

	PyList* env = new PyList;
	env->AddItem(new PyInt(shipEff.itemID));
	env->AddItem(new PyInt(m_Ship->ownerID()));
	env->AddItem(new PyInt(m_Ship->itemID()));
	env->AddItem(new PyInt(targetID));
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyInt(10));

	shipEff.environment = env;
	shipEff.startTime = shipEff.when;
	shipEff.duration = 1584;
	shipEff.repeat = new PyInt(0);
	shipEff.randomSeed = new PyNone;
	shipEff.error = new PyNone;

	PyList* events = new PyList;
	events->AddItem(shipEff.Encode());

	Notify_OnMultiEvent multi;
	multi.events = events;

	PyTuple* tmp = multi.Encode();

	m_Ship->GetOperator()->SendDogmaNotification("OnMultiEvent", "clientID", &tmp);
}
Exemplo n.º 2
0
void Webifier::StopCycle(bool abort)
{
    double timeLeft = m_AMPC->GetRemainingCycleTimeMS();
    timeLeft /= 100;

    // Create Special Effect:
    m_Ship->GetPilot()->GetShipSE()->DestinyMgr()->SendSpecialEffect
    (
        m_Ship,
        m_Item->itemID(),
        m_Item->typeID(),
        m_targetID,
        0,
        "effect.decreaseTargetSpeed",
        0,
        0,
        0,
        timeLeft,
        0
     );

    // Create Destiny Updates:
    GodmaOther go;
        go.shipID = m_Ship->itemID();
        go.slotID = m_Item->flag();
        go.chargeTypeID = 0;

    GodmaEnvironment ge;
        ge.selfID = m_Item->itemID();
        ge.charID = m_Ship->ownerID();
        ge.shipID = go.shipID;
        ge.targetID = m_targetID;
        ge.other = go.Encode();
        ge.area = new PyList;
        ge.effectID = effectDecreaseTargetSpeed;

    Notify_OnGodmaShipEffect shipEff;
        shipEff.itemID = ge.selfID;
        shipEff.effectID = ge.effectID;
        shipEff.timeNow = Win32TimeNow();
        shipEff.start = 0;
        shipEff.active = 0;
        shipEff.environment = ge.Encode();
        shipEff.startTime = (shipEff.timeNow - (timeLeft * Win32Time_Second));
        shipEff.duration = timeLeft;
        shipEff.repeat = 0;
        shipEff.error = new PyNone;

    PyList* events = new PyList;
        events->AddItem(shipEff.Encode());

    Notify_OnMultiEvent multi;
        multi.events = events;

    PyTuple* tmp2 = multi.Encode();

    m_Ship->GetPilot()->SendNotification("OnMultiEvent", "clientID", &tmp2);
}
Exemplo n.º 3
0
void MissileLauncher::StopCycle(bool abort)
{
	// Do one last cycle:
	DoCycle();

	Notify_OnGodmaShipEffect shipEff;
	shipEff.itemID = m_Item->itemID();
	shipEff.effectID = effectMissileLaunching;
	shipEff.when = Win32TimeNow();
	shipEff.start = 0;
	shipEff.active = 0;

	PyList* env = new PyList;
	env->AddItem(new PyInt(shipEff.itemID));
	env->AddItem(new PyInt(m_Ship->ownerID()));
	env->AddItem(new PyInt(m_Ship->itemID()));
	env->AddItem(new PyInt(m_targetID));
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyInt(shipEff.effectID));

	shipEff.environment = env;
	shipEff.startTime = shipEff.when;
	shipEff.duration = 1.0;		//m_ActiveModuleProc->GetRemainingCycleTimeMS();		// At least, I'm assuming this is the remaining time left in the cycle
	shipEff.repeat = new PyInt(0);
	shipEff.randomSeed = new PyNone;
	shipEff.error = new PyNone;

	PyList* events = new PyList;
	events->AddItem(shipEff.Encode());

	Notify_OnMultiEvent multi;
	multi.events = events;

	PyTuple* tmp = multi.Encode();

	m_Ship->GetOperator()->SendDogmaNotification("OnMultiEvent", "clientID", &tmp);

	// Create Special Effect:
	m_Ship->GetOperator()->GetDestiny()->SendSpecialEffect
	(
		m_Ship,
		m_Item->itemID(),
		m_Item->typeID(),
		m_targetID,
		m_chargeRef->itemID(),
		"effects.MissileDeployment",
		1,
		0,
		0,
		1.0,
		0
	);

	m_ActiveModuleProc->DeactivateCycle();
}
Exemplo n.º 4
0
void ShieldHardener::StopCycle(bool abort)
{
    // Create Destiny Updates:
    GodmaOther go;
        go.shipID = m_Ship->itemID();
        go.slotID = m_Item->flag();
        go.chargeTypeID = 0;

    GodmaEnvironment ge;
        ge.selfID = m_Item->itemID();
        ge.charID = m_Ship->ownerID();
        ge.shipID = go.shipID;
        ge.targetID = 0;
        ge.other = go.Encode();
        ge.area = new PyList;
        ge.effectID = effectModifyActiveShieldResonanceAndNullifyPassiveResonance;

    uint32 timeLeft = m_AMPC->GetRemainingCycleTimeMS();
    timeLeft /= 100;

    Notify_OnGodmaShipEffect shipEff;
        shipEff.itemID = ge.selfID;
        shipEff.effectID = ge.effectID;
        shipEff.timeNow = Win32TimeNow();
        shipEff.start = 0;
        shipEff.active = 0;
        shipEff.environment = ge.Encode();
        shipEff.startTime = (shipEff.timeNow - (timeLeft * Win32Time_Second));
        shipEff.duration = timeLeft;
        shipEff.repeat = 0;
        shipEff.error = new PyNone;

    PyList* events = new PyList;
        events->AddItem(shipEff.Encode());

    Notify_OnMultiEvent multi;
        multi.events = events;

    PyTuple* tmp = multi.Encode();

    m_Ship->GetPilot()->SendNotification("OnMultiEvent", "clientID", &tmp);
}
Exemplo n.º 5
0
void InventoryItem::SetOnline(bool newval) {

    SetAttribute(AttrIsOnline, int(newval));

    Client *c = sEntityList.FindCharacter(m_ownerID);
    if(c == NULL)
    {
        sLog.Error("InventoryItem", "unable to set ourselfs online//offline because we can't find the client");
        return;
    }

    Notify_OnGodmaShipEffect ogf;
    ogf.itemID = m_itemID;
    ogf.effectID = effectOnline;
    ogf.when = Win32TimeNow();
    ogf.start = newval?1:0;
    ogf.active = newval?1:0;
	//list start
    ogf.env_itemID = ogf.itemID;
    ogf.env_charID = m_ownerID; //??
    ogf.env_shipID = m_locationID;
    ogf.env_target = m_locationID;
    ogf.env_effectID = ogf.effectID;
    ogf.startTime = ogf.when;
	ogf.duration = ogf.duration; //INT_MAX; //I think this should be infinity (0x07 may be infinity?)
    //list end
	if(newval)
		ogf.repeat = new PyInt(1000);
    else
        ogf.repeat = new PyInt(0);
    ogf.randomSeed = new PyNone();
    ogf.error = new PyNone();
	ogf.env_other = new PyNone();
	ogf.env_area = new PyList();

    Notify_OnMultiEvent multi;
    multi.events = new PyList;
    multi.events->AddItem( ogf.Encode() );

    PyTuple* tmp = multi.Encode();   //this is consumed below
    c->SendNotification("OnMultiEvent", "clientID", &tmp);
}
Exemplo n.º 6
0
void InventoryItem::SetOnline(bool online) {

    SetAttribute(AttrIsOnline, int(online));

    Client *c = sEntityList.FindCharacter(m_ownerID);
    if(c == NULL)
    {
        sLog.Error("InventoryItem", "unable to set ourselfs online//offline because we can't find the client");
        return;
    }

    Notify_OnGodmaShipEffect ogf;
    ogf.itemID = m_itemID;
    ogf.effectID = effectOnline;
    ogf.when = Win32TimeNow();
    ogf.start = online?1:0;
    ogf.active = online?1:0;

	PyList *environment = new PyList;
	environment->AddItem(new PyInt(ogf.itemID));
	environment->AddItem(new PyInt(m_ownerID));
	environment->AddItem(new PyInt(m_locationID));
	environment->AddItem(new PyNone);
	environment->AddItem(new PyNone);
	environment->AddItem(new PyNone);
	environment->AddItem(new PyInt(ogf.effectID));
	
	ogf.environment = environment;
	ogf.startTime = ogf.when;
	ogf.duration = 10000;
	ogf.repeat = online?new PyInt(1000):new PyInt(0);
    ogf.randomSeed = new PyNone();
    ogf.error = new PyNone();

    Notify_OnMultiEvent multi;
    multi.events = new PyList;
    multi.events->AddItem( ogf.Encode() );

    PyTuple* tmp = multi.Encode();   //this is consumed below
    c->SendNotification("OnMultiEvent", "clientID", &tmp);
}
Exemplo n.º 7
0
void InventoryItem::SetActive(bool active, uint32 effectID, double duration, bool repeat)
{
	Client* c = sEntityList.FindCharacter(m_ownerID);
    if(c == NULL)
    {
        sLog.Error("InventoryItem", "unable to set ourselfs online//offline because we can't find the client");
        return;
    }

	Notify_OnGodmaShipEffect shipEffect;

	shipEffect.itemID = m_itemID;
	shipEffect.effectID = effectID;
	shipEffect.when = Win32TimeNow();
	shipEffect.start = active?1:0;
	shipEffect.active = active?1:0;

	PyList* env = new PyList;
	env->AddItem(new PyInt(m_itemID));
	env->AddItem(new PyInt(ownerID()));
	env->AddItem(new PyInt(m_locationID));
	env->AddItem(new PyNone);				//targetID
	env->AddItem(new PyNone);				//otherID
	env->AddItem(new PyNone);				//area
	env->AddItem(new PyInt(effectID));

	shipEffect.environment = env;
	shipEffect.startTime = shipEffect.when;
	shipEffect.duration = duration;
	shipEffect.repeat = repeat?new PyInt(1000):new PyInt(0);
	shipEffect.randomSeed = new PyNone;
	shipEffect.error = new PyNone;

	Notify_OnMultiEvent multi;
    multi.events = new PyList;
    multi.events->AddItem(shipEffect.Encode());

    PyTuple* tmp = multi.Encode();   //this is consumed below
    c->SendNotification("OnMultiEvent", "clientID", &tmp);
}
Exemplo n.º 8
0
void EnergyTurret::Deactivate() 
{
	Notify_OnGodmaShipEffect shipEff;
	shipEff.itemID = m_Item->itemID();
	shipEff.effectID = effectTargetAttack;
	shipEff.when = Win32TimeNow();
	shipEff.start = 0;
	shipEff.active = 0;

	PyList* env = new PyList;
	env->AddItem(new PyInt(shipEff.itemID));
	env->AddItem(new PyInt(m_Ship->ownerID()));
	env->AddItem(new PyInt(m_Ship->itemID()));
	env->AddItem(new PyInt(m_targetEntity->GetID()));
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyInt(10));

	shipEff.environment = env;
	shipEff.startTime = shipEff.when;
	shipEff.duration = m_ActiveModuleProc->GetRemainingCycleTimeMS();		// At least, I'm assuming this is the remaining time left in the cycle
	shipEff.repeat = new PyInt(0);
	shipEff.randomSeed = new PyNone;
	shipEff.error = new PyNone;

	PyList* events = new PyList;
	events->AddItem(shipEff.Encode());

	Notify_OnMultiEvent multi;
	multi.events = events;

	PyTuple* tmp = multi.Encode();

	m_Ship->GetOperator()->SendDogmaNotification("OnMultiEvent", "clientID", &tmp);

	m_ActiveModuleProc->DeactivateCycle();
}
Exemplo n.º 9
0
void SuperWeapon::StopCycle(bool abort)
{
	// TODO:
	// 1. Enable warping and jump drive

	std::string effectString;
	switch (m_Item->typeID())
	{
		case 24550:
			effectString = "effects.SuperWeaponAmarr";
			m_effectID = effectSuperWeaponAmarr;
			break;

		case 24552:
			effectString = "effects.SuperWeaponCaldari";
			m_effectID = effectSuperWeaponCaldari;
			break;

		case 24554:
			effectString = "effects.SuperWeaponGallente";
			m_effectID = effectSuperWeaponGallente;
			break;

		case 23674:
			effectString = "effects.SuperWeaponMinmatar";
			m_effectID = effectSuperWeaponMinmatar;
			break;

		default:
			effectString = "";
			m_effectID = 0;
			break;
	}

	Notify_OnGodmaShipEffect shipEff;
	shipEff.itemID = m_Item->itemID();
	shipEff.effectID = m_effectID;
	shipEff.when = Win32TimeNow();
	shipEff.start = 0;
	shipEff.active = 0;

	PyList* env = new PyList;
	env->AddItem(new PyInt(shipEff.itemID));
	env->AddItem(new PyInt(m_Ship->ownerID()));
	env->AddItem(new PyInt(m_Ship->itemID()));
	env->AddItem(new PyInt(m_targetID));
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyInt(shipEff.effectID));

	shipEff.environment = env;
	shipEff.startTime = shipEff.when;
	shipEff.duration = 1.0;		//m_ActiveModuleProc->GetRemainingCycleTimeMS();		// At least, I'm assuming this is the remaining time left in the cycle
	shipEff.repeat = new PyInt(0);
	shipEff.randomSeed = new PyNone;
	shipEff.error = new PyNone;

	PyList* events = new PyList;
	events->AddItem(shipEff.Encode());

	Notify_OnMultiEvent multi;
	multi.events = events;

	PyTuple* tmp = multi.Encode();

	m_Ship->GetOperator()->SendDogmaNotification("OnMultiEvent", "clientID", &tmp);

	m_ActiveModuleProc->DeactivateCycle();

	// Create Special Effect:
	m_Ship->GetOperator()->GetDestiny()->SendSpecialEffect
		(
		m_Ship,
		m_Item->itemID(),
		m_Item->typeID(),
		m_targetID,
		0,
		effectString,
		1,
		0,
		0,
		1.0,
		0
		);
}
Exemplo n.º 10
0
void Afterburner::StopCycle(bool abort)
{
	//m_Item->SetActive(false, 1253, 0.0, false);

	// Tell Destiny Manager about our new speed so it properly tracks ship movement:
	m_Ship->GetOperator()->GetDestiny()->SetMaxVelocity(m_Ship->GetDefaultAttribute(AttrMaxVelocity).get_float());
	m_Ship->GetOperator()->GetDestiny()->SetSpeedFraction(1.0);

	DoDestiny_SetMaxSpeed speed;
	speed.entityID = m_Ship->itemID();
	speed.speedValue = m_Ship->GetDefaultAttribute(AttrMaxVelocity).get_float();

	DoDestiny_SetBallMass mass;
	mass.entityID = m_Ship->itemID();
	mass.mass = m_Ship->GetAttribute(AttrMass).get_float();

	std::vector<PyTuple *> updates;
	updates.push_back(speed.Encode());
	updates.push_back(mass.Encode());

	m_ActiveModuleProc->DeactivateCycle();

	m_Ship->GetOperator()->GetDestiny()->SendDestinyUpdate(updates, false);

	Notify_OnGodmaShipEffect shipEff;
	shipEff.itemID = m_Item->itemID();
	shipEff.effectID = 1254;
	shipEff.when = Win32TimeNow();
	shipEff.start = 0;
	shipEff.active = 0;

	PyList* env = new PyList;
	env->AddItem(new PyInt(shipEff.itemID));
	env->AddItem(new PyInt(m_Ship->ownerID()));
	env->AddItem(new PyInt(m_Ship->itemID()));
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyInt(shipEff.effectID));

	shipEff.environment = env;
	shipEff.startTime = shipEff.when;
	shipEff.duration = 1.0;		//m_ActiveModuleProc->GetRemainingCycleTimeMS();		// At least, I'm assuming this is the remaining time left in the cycle
	shipEff.repeat = new PyInt(0);
	shipEff.randomSeed = new PyNone;
	shipEff.error = new PyNone;

	PyList* events = new PyList;
	events->AddItem(shipEff.Encode());

	Notify_OnMultiEvent multi;
	multi.events = events;

	PyTuple* tmp = multi.Encode();

	m_Ship->GetOperator()->SendDogmaNotification("OnMultiEvent", "clientID", &tmp);

	m_ActiveModuleProc->DeactivateCycle();

	// Create Special Effect:
	m_Ship->GetOperator()->GetDestiny()->SendSpecialEffect
		(
		m_Ship,
		m_Item->itemID(),
		m_Item->typeID(),
		0,
		0,
		"effects.SpeedBoost",
		0,
		0,
		0,
		1.0,
		0
		);
}