Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Added mvp reward #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions src/Engine/MapEngine/Entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ define(function( require )
var StatusIcons = require('UI/Components/StatusIcons/StatusIcons');
var BasicInfo = require('UI/Components/BasicInfo/BasicInfo');
var Escape = require('UI/Components/Escape/Escape');
var StrEffect = require('Renderer/Effects/StrEffect');
var DB = require('DB/DBManager');


/**
/**
* Spam an entity on the map
* Generic packet handler
*/
Expand Down Expand Up @@ -478,7 +480,31 @@ define(function( require )
}


/**
/**
* Show MvP reward Effect
*
* @param {object} pkt - PACKET.ZC.MVP
*/
function onEntityMvpReward( pkt )
{
var Entity = EntityManager.get(pkt.AID);
EffectManager.add(new StrEffect('data/texture/effect/mvp.str', Entity.position, Renderer.tick), pkt.AID);
Sound.play('effect/st_mvp.wav');
}

/**
* Show MvP item message
*
* @param {object} pkt - PACKET.ZC.MVP_GETTING_ITEM
*/
function onEntityMvpRewardItemMessage( pkt ) {
var item = DB.getItemInfo(pkt.ITID);
ChatBox.addText(DB.getMessage(143), ChatBox.TYPE.BLUE);
ChatBox.addText(item.identifiedDisplayName, ChatBox.TYPE.BLUE);
}


/**
* Updating entity direction
*
* @param {object} pkt - PACKET.ZC.CHANGE_DIRECTION
Expand Down Expand Up @@ -1024,5 +1050,7 @@ define(function( require )
Network.hookPacket( PACKET.ZC.RESURRECTION, onEntityResurect);
Network.hookPacket( PACKET.ZC.EMOTION, onEntityEmotion);
Network.hookPacket( PACKET.ZC.NOTIFY_MONSTER_HP, onEntityLifeUpdate);
Network.hookPacket( PACKET.ZC.MVP, onEntityMvpReward);
Network.hookPacket( PACKET.ZC.MVP_GETTING_ITEM, onEntityMvpRewardItemMessage);
};
});